A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pandas-dev/pandas/issues/9100 below:

Iteration over datetime index · Issue #9100 · pandas-dev/pandas · GitHub

When iterating over a Series of datetime objects that have timezone info on them, the returned value has the timezone info but also alters the time according to that timezone info, as seen in example below:

time_points is the index of a dataframe with values:

[2014-12-01 03:32:39.987000-08:00, ..., 2014-12-01 04:12:34.987000-08:00]
Length: 4, Freq: None, Timezone: tzoffset(None, -28800)
2014-12-01 03:32:39.987000-08:00
2014-12-01 03:52:38.987000-08:00
2014-12-01 04:02:36.987000-08:00
2014-12-01 04:12:34.987000-08:00 

However, for the following command:

for time in time_points:
    print time

the output is:

2014-12-01 11:32:39.987000-08:00
2014-12-01 11:52:38.987000-08:00
2014-12-01 12:02:36.987000-08:00
2014-12-01 12:12:34.987000-08:00

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4