I have a dataframe called winter_df with two columns...
Germany_consumption Date
Date
2018-01-01 44360.125000 2018-01-01
2018-01-02 56385.958333 2018-01-02
2018-01-03 61500.500000 2018-01-03
2018-01-04 61227.375000 2018-01-04
2018-01-05 60049.333333 2018-01-05
I would like to make a simple scatter plot using Date as the X column and Germany_consumption as the y column.
However, when I attempt to do this I get the following error:
winter_df.plot.scatter(x='Date',y='Germany_consumption')
ValueError: scatter requires x column to be numeric
I can map the date to an ordinal value using the map() function, but then my x-axis xtick values are numeric rather than the datetime format that I want.
I couldn't find any satisfactory answers myself when researching this so I'm wondering if anyone has a good solution for how to do this.
Thanks