Код: Выделить всё
import matplotlib
f= plt.figure(figsize=(12,4))
ax = f.add_subplot(111)
df.set_index('timestamp')['values'].plot(ax=ax)
ax.xaxis.set_major_locator(matplotlib.dates.HourLocator(interval=1))
ax.xaxis.set_major_formatter(matplotlib.dates.DateFormatter('%I'))
plt.show()
Код: Выделить всё
> df['timestamp'][0]
Timestamp('2014-09-02 18:37:00-0400', tz='US/Eastern')
Код: Выделить всё
ax.xaxis.set_major_formatter(matplotlib.dates.DateFormatter('%I'))
Почему?
Подробнее здесь: https://stackoverflow.com/questions/256 ... g-timezone
Мобильная версия