I’m novice in python, and I couldn’t understand how to correctly formatting dates.
My data is like this Fri, 09 Dec 2011 06:50:37 UTC
I’m preparing it like this:
dates.append(time.strptime(row[5], "%a, %d %b %Y %H:%M:%S %Z"))
Then I’m trying to use it
dates = matplotlib.dates.date2num(dates)
get following error:
AttributeError: 'time.struct_time' object has no attribute 'toordinal'
You are using the
timemodule, butmatplotlibexpects thedatetimeobject.Try using something like this: