Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
aa1371 opened this issue Dec 6, 2018 · 0 comments · Fixed by #52991
Closed

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

aa1371 opened this issue Dec 6, 2018 · 0 comments · Fixed by #52991
Labels
Bug Frequency DateOffsets Period Period data type

Comments

@aa1371
Copy link
Contributor

aa1371 commented Dec 6, 2018

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Frequency DateOffsets Period Period data type
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants