. Advertisement .
..3..
. Advertisement .
..4..
Here is the program I run:
2 3
0 1300 1000
1 242751149 199446827
2 237712649 194704827
3 16.2 23.0
df.plot()
After I run, it returns an error:
Library/Python/2.7/site-packages/pandas-0.16.2-py2.7-macosx-10.10-intel.egg/pandas/tools/plotting.pyc in _compute_plot_data(self)
1015 if is_empty:
1016 raise TypeError('Empty {0!r}: no numeric data to '
-> 1017 'plot'.format(numeric_data.__class__.__name__))
1018
1019 self.data = numeric_data
TypeError: Empty 'DataFrame': no numeric data to plot
Does anyone have any suggestions for the problem below: typeerror: empty ‘dataframe’: no numeric data to plot in the python. How to correct it?
The cause:
The main reason of this error is that you are try ing to plot values from pandas DataFrame, but there are no numeric values shown in DataFrame.
Solution:
This error can simply be solved by using numeric to replace the particular column or columns that you want. Now I will create a simple dataframe with
pandas
andnumpy
to help you understand better. Let’s follow it:Before you start plotting, try these: