Closed kmatt closed 9 years ago
Apparently numpy.polyfit does not accept dates, but will use matplotlib dates. Perhaps to_pydatetime() is an option here?
Hi. Thanks for your comment. Since p.regplot is focused on doing regression, I'm not sure I understand how you would regress against a datetime value. Wouldn't you need time expressed in an explicit unit (e.g. second, day, etc)? In that case I would probably just transform dates to number of units (sec, min, hr, day) after some start time and do the regression from there. Does this make sense?
It does - I was looking at the format of the x-axis with date labels. Converting the dates to seconds since epoch displayed the chart correctly, although without the actual date values on the axis.
Yea. I can't think of a good way to both do the regression and plot dates on x. If you can think of a way, I'd be all ears.
p.plot seems to work with an x-axis containing dates in strings (YYYY-MM-DD), but p.regplot does not, even if the column is cast to a datetime: