Solid field DataFrame

Can an empty DataFrame be formatted? I fill in xlim

and yticks

, I do not understand why this should not be possible.

>>> df
Empty DataFrame
Columns: [time, ch, 0]
Index: []

>>> df.plot(x="time", y="ch",
            ax=ax,
            ...
            xlim=(start, end),
            yticks=range(ymin, ymax+1))
...
TypeError: Empty 'DataFrame': no numeric data to plot

      

Also tried to build with help matplotlib.pyplot

, but it ends with KeyError

if I pass ax

.

>>> plt.plot()
>>> plt.axes(ax)
...
KeyError: <matplotlib.axes._subplots.AxesSubplot object at 0x00000000060E6BE0>

      

+3
python python-3.x pandas


source to share


No one has answered this question yet

Check out similar questions:

3235
How to check if a list is empty?
1462
How to iterate over rows in a DataFrame in Pandas?
1419
Select rows from DataFrame based on values ​​in column in pandas
1033
Remove column from panda DataFrame
889
Selecting multiple columns in pandas dataframe
879
Get list from pandas DataFrame column headers
815
Adding a new column to an existing DataFrame in Python pandas
625
How do I change the order of the columns of a DataFrame?
43
python pandas slicing data by date
0
Pandas DataFrame (TypeError: Empty 'DataFrame': no ​​numeric data to build)



All Articles
Loading...
X
Show
Funny
Dev
Pics