Skip to content

0.15.2: Iteration over datetime index #9100

Closed
@Oxtay

Description

@Oxtay

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions