question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

What 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:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
MMS413commented, Aug 6, 2020

Yes, thank you @dalthviz

1reaction
MMS413commented, Aug 6, 2020

Thanks, @dalthviz !

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found