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


source to share





All Articles