You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tests.plotting.test_frame.TestDataFramePlots.test_subplots_timeseries_y_axis issues a warning when plotting a datetime64[tz] column:
pandas/tests/plotting/test_frame.py::TestDataFramePlots::test_subplots_timeseries_y_axis
/Users/bmendel/Desktop/pd/matwarns/pandas/plotting/_core.py:384: FutureWarning: Converting timezone-aware DatetimeArray to timezone-naive ndarray with 'datetime64[ns]' dtype. In the future, this will return an ndarray with 'object' dtype where each element is a 'pandas.Timestamp' with the correct 'tz'.
To accept the future behavior, pass 'dtype=object'.
To keep the old behavior, pass 'dtype="datetime64[ns]"'.
numeric_data[col] = np.asarray(numeric_data[col])
The axis formatting is the default Matplotlib datetime formatting, which is currently "3 significant bits", so in this case month-day hour. In this case it isn't the best, but I think it plays nicely with different zoom levels. Suggestions for improvements welcome on the Matplotlib bug tracker!
I think the warning is being emitted by numpy? The call np.asarray() is trying to cast some timezone aware stuff to np.datetime64, which I think is dropping timezone support soon.
tests.plotting.test_frame.TestDataFramePlots.test_subplots_timeseries_y_axis issues a warning when plotting a datetime64[tz] column:
The relevant code is:
Checking the actual images generated by these last two:


The UTC is completely lost for the tz-aware case, and in both cases the dates are rendered without year and with weird-looking hour.
The text was updated successfully, but these errors were encountered: