Przy drukowaniu timeseries z wbudowaną funkcją fabuły pand, zdaje się ignorować strefę czasową mojego indeksu: zawsze używa czasu UTC dla osi X. Przykład:Funkcja wykresów pand ignoruje strefę czasową timeseries
import numpy as np
import matplotlib.pyplot as plt
from pandas import rolling_mean, DataFrame, date_range
rng = date_range('1/1/2011', periods=200, freq='S', tz="UTC")
data = DataFrame(np.random.randn(len(rng), 3), index=rng, columns=['A', 'B', 'C'])
data_cet = data.tz_convert("CET")
# plot with data in UTC timezone
fig, ax = plt.subplots()
data[["A", "B"]].plot(ax=ax, grid=True)
plt.show()
# plot with data in CET timezone, but the x-axis remains the same as above
fig, ax = plt.subplots()
data_cet[["A", "B"]].plot(ax=ax, grid=True)
plt.show()
Działka nie zmienia, mimo że wskaźnik ma:
In [11]: data.index[0]
Out[11]: <Timestamp: 2011-01-01 00:00:00+0000 UTC, tz=UTC>
In [12]: data_cet.index[0]
Out[12]: <Timestamp: 2011-01-01 01:00:00+0100 CET, tz=CET>
powinienem zgłosić błąd, czy mogę coś przeoczyć?
[tutaj] (https://stackoverflow.com/a/46554146/2192488) jest jak ten błąd można obejść! –