How to set x axis labels as dates in pandas plot with a dataframe timestamp column

Viewed 2520

I have a pandas dataframe (Jupyter) with two column, a datetime64[ns] (named day) and int64 (named events).

I want to plot the int64 column, using as x axis labels the datetime64[ns] (properly formatted).

I tried:

events_per_day.plot(kind='line', xticks=events_per_day['day'], ...

but I get:

TypeError: Cannot compare type 'Timestamp' with type 'float'

How to solve this problem?

1 Answers
Related