Skip to content

BUG - PeriodIndex.freq.normalize option gets cached per process #24121

Closed
@ms7463

Description

@ms7463

It seems that whatever normalize option is first called for a PeriodIndex freq it is used for the rest of the process (on a per offset type basis). No matter whether the freq is explicitly overwritten with a freq using a different normalize option. This is NOT the case for the offset kwds.

>>> pd.PeriodIndex(['19910905'], freq=pd.offsets.YearEnd(normalize=True)).freq.normalize
True
>>> pd.PeriodIndex(['19910905'], freq=pd.offsets.YearEnd(normalize=False)).freq.normalize
True

Restart the process

>>> pd.PeriodIndex(['19910905'], freq=pd.offsets.YearEnd(normalize=False)).freq.normalize
False
>>> pd.PeriodIndex(['19910905'], freq=pd.offsets.YearEnd(normalize=True)).freq.normalize
False

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions