-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
API: Change Period('NAT') to return NaT #13609
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
Conversation
CC @MaximilianR |
Current coverage is 84.38%@@ master #13609 diff @@
==========================================
Files 142 142
Lines 51225 51225
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
- Hits 43225 43224 -1
- Misses 8000 8001 +1
Partials 0 0
|
``Period('NaT')`` now returns ``pd.NaT`` | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
Previously, ``Period`` has its own ``Periond('NaT')`` representation different from ``pd.NaT``. Now ``Period('NaT')`` has been changed to return ``pd.NaT``. (:issue:`12759`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Periond -> Period
@sinhrks Can you rebase this? Then it will be easier to review the additional changes (as I think the first commit is now already in master?) |
0937517
to
3aff2be
Compare
@jorisvandenbossche sure. rebased. |
thanks @sinhrks this is really nice! |
git diff upstream/master | flake8 --diff
pd.Period('NaT', freq='D')
now returnspd.NaT
rather than its own nat repr.Period
arithmetic,pd.NaT
now supports addition / subtraction withint
(previouslyValueError
).Added tests for following:
Period
andPeriodIndex
,Series
opsPeriodIndex
creation from list-like which containsPeriod
andNaT
(ENH: PeriodIndex now accepts pd.NaT #13430)PeriodIndex
boxing.to_period
__contains__
any NaT-like(pd.NaT, None, float('nan'), np.nan
)