Skip to content

weekofyear gives different results on a DatetimeIndex (if tz is given) #6538

Closed
@sdementen

Description

@sdementen

Hello,

The following code

dates = ["2013/12/29", "2013/12/30", "2013/12/31"]
dates = pandas.DatetimeIndex(dates, tz="Europe/Brussels")
print dates.weekofyear
print [d.weekofyear for d in dates]

gives

[52  1  1]
[52, 52, 1]

i.e. calling weekofyear on the datetimeindex directly or iterating on the different dates of the datetimeindex gives different results.

Notice that if we remove the tz in the DatetimeIndex, the results are consistant.

Sébastien

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