Reputation: 413
I declared pd as follow:
# import our packages
import pandas as pd
%matplotlib inline
so far so good, but then when I run this line( or better I scroll to the next cell with shift+enter)
myExploratoryData=pd.read_csv("~/Downloads/Ex_Files_Data_Science_Of_Marketing/02_03/exploratory-py.cvs")
I get this error. I tried to reset and restart as was indicated on a similar stackoverflow post, but does not work. I do not get I defined/imported 'pd'. I am running python 3 on linux with Anaconda and Jupyter
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-1-e1875e3c3f52> in <module>()
1 # connect to our data
----> 2 myExploratoryData=pd.read_csv("~/Downloads/Ex_Files_Data_Science_Of_Marketing/02_03/exploratory-py.cvs")
NameError: name 'pd' is not defined
Upvotes: 1
Views: 2640
Reputation: 526
I had the same problem. I am using PyCharm Community Edition. The following was the error message:
"DeprecationWarning: Pyarrow will become a required dependency of pandas in the next major release of pandas (pandas 3.0),(to allow more performant data types, such as the Arrow string type, and better interoperability with other libraries) but was not found to be installed on your system. If this would cause problems for you, please provide us feedback at https://github.com/pandas-dev/pandas/issues/54466
import pandas as pd"
After installing pyarrow, the problem was solved.
Upvotes: 0
Reputation: 849
Are those lines of code in separate cells? Make sure you run the cell with import pandas as pd
before you run the code that requires pandas. This seems like a basic fix but I can't tell what else you could have done wrong.
Also, try and do a clean run so kernal -> clear output
Upvotes: 3