Error message 'Data frame name not defined' when plotting histogram in python
Question:
I want to plot a histogram for all numerical columns in my data frame. An error message keeps on coming up saying my data frame name (Cab_Data) is not defined.
I have installed and imported matplotlib as plt, I used the code below to plot the histograms
Cab_Data.hist()
It returns the error message
NameError: name ‘Cab_Data’ is not defined
Answers:
Could you upload the full code you have when creating histogram? To provide a bit more context.
Absolutely. Yup, you have to load the DataFrame in every time you load your instance of Python.
I want to plot a histogram for all numerical columns in my data frame. An error message keeps on coming up saying my data frame name (Cab_Data) is not defined.
I have installed and imported matplotlib as plt, I used the code below to plot the histograms
Cab_Data.hist()
It returns the error message
NameError: name ‘Cab_Data’ is not defined
Could you upload the full code you have when creating histogram? To provide a bit more context.
Absolutely. Yup, you have to load the DataFrame in every time you load your instance of Python.