When plotting time series with the built-in pandas plotting function, it seems to ignore the time zone of my index: it always uses UTC for the x axis. Example:
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")
The graph does not change, although the index has:
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>
Should I write a mistake or am I missing something?
joris source share