Skip to content

Inconsistent behaviour of to_period #2232

Closed
@killinc

Description

@killinc

to_period works correctly on individual timestamp objects with timezone information. When it is applied to datetime indexes with timezone information though, the conversion appears to happen based on the underlying UTC timestamp.
For example:
index = date_range('2000-1-1', periods=1000, freq='D', tz = 'Australia/Sydney')
index[0].to_period('D') # gives a different result from:
index.to_period('D')[0]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions