NameError
See original GitHub issueWhat steps reproduce the problem?
These commands: import pandas import numpy
data = pandas.read_csv(“nesarc_pds.csv”, low_memory=False)
print(len(data)) print(len(data.columns))
What is the expected output? What do you see instead?
Paste Traceback/Error Below (if applicable)
Produced the following response: In [2]: print(len(data.columns)) Traceback (most recent call last):
File “<ipython-input-2-edddc1643118>”, line 1, in <module> print(len(data.columns))
NameError: name ‘data’ is not defined
PASTE TRACEBACK HERE
Versions
- Spyder version: Spyder (Python 3.7)
- Python version:
- Qt version:
- PyQt version:
- Operating System name/version:
Dependencies
PASTE DEPENDENCIES HERE
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Handling NameError Exception in Python - GeeksforGeeks
There are several standard exceptions in Python and NameError is one among them. NameError is raised when the identifier being accessed is ...
Read more >Built-in Exceptions — Python 3.11.1 documentation
exception NameError¶. Raised when a local or global name is not found. This applies only to unqualified names. The associated value is an...
Read more >How NameError Works in Python with Examples - eduCBA
NameError is a kind of error in python that occurs when executing a function, variable, library or string without quotes that have been...
Read more >Python nameerror name is not defined Solution - Career Karma
A NameError is raised when you try to use a variable or a function name that is not valid. In Python, code runs...
Read more >NameError Exception in Python - Pylenin
The NameError exception in Python is raised when the object being accessed is not defined in the local or global scope of your...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes, thank you @dalthviz
Thanks, @dalthviz !