Skip to content Skip to sidebar Skip to footer

Plotting Dataframe Raises Error Of Ordinal Value Must Be >= 1

I follow the tutorial at http://nbviewer.ipython.org/github/jvns/pandas-cookbook/blob/v0.1/cookbook/Chapter%205%20-%20Combining%20dataframes%20and%20scraping%20Canadian%20weather%2

Solution 1:

I was getting this error in ipython even with current pandas 0.20.3

Traced it down to having run a script beforehand which saved a figure with a different index, but hadn't done plt.show() as the figure had been saved and I didn't need to see it.

So as @naught101 hinted, forcing plt.close('all') before showing the next figure fixes the issue. Probably good practice at the end of scripts anyway.

Solution 2:

This was a bug in pandas: 0.18.1 and fixed in 0.19.2, eg run conda upgrade pandas

Post a Comment for "Plotting Dataframe Raises Error Of Ordinal Value Must Be >= 1"