I'm loading a data file, extracting certain columns, and plotting them to PDF with matplotlib.
When I load my data file it into Pandas, I get a DateTimeIndex. If I plot the data in this form, all goes well.
The problem arises when I select a subset of the data based on the time, ie:
data = data.ix[data.index >= start_time]
data = data.ix[data.index <= end_time]
Now when I go to plot the data, pandas seems to have changed something because the DateTimeIndex is an array of npdatetime64 types, which are apparently unsupported by matplotlib and throw an error. (something in datetime.fromordinal)
How can I get around this problem?
I've tried plotting:
data.index.value.astype(datetime)
But this still throws an error within matplotlib! (Python int can't be converted to C long)
Is there a way I can prevent pandas for ruining the data in the first place when I ix it?
I'm using Python 2.7, Numpy 1.7, pandas 0.11, matplotlib 1.2.1.
EDIT: It seems that I am experiencing the same problem as seen here: Plot numpy datetime64 with matplotlib