Open realSAH opened 2 years ago
Hi @southaustralia,
thanks for reporting. Try to pass date/time strings instead using the datetime_to_string()
or datetimes_to_string()
methods. Does it work?
plotext
does not allow datetime
object directly in the plotting functions for now.
Which makes me think, that it could probably be a good added feature. If you think it could, we could rename this issue as a Feature Request about it.
thanks, Savino
Hi, thanks for the suggestion. I was forced to do this df['date'].apply(lambda x: x.strftime("%d/%m/%Y"))
Anything other than literally this will cause an error saying ValueError: Date Form should be: %d/%m/%Y
My datetime column happen to be in hours range while the year, month and day don't change, so even thought the API accepted my syntax the plot wasn't correct.
I think supporting datetime object out of the box will implicitly solve the problem. Thank you for your time.
Hi @southaustralia,
this is something I could definitively work on. In the mean time here is a guide to deal with date/time plots for now: basically one needs to specify the datetime form with date_form()
and convert to string with datetime_to_string()
or datetimes_to_string()
methods, and pass the string to the plot (instead of the datetime
objects for now).
If the guide is not clear, some feedback is appreciated to improve it.
Thanks, Savino
Just to update and apologise: I have been quite busy rewriting the package from ground up and will update.
I'm plotting with x axis being datetime object and got this pandas error: