API: Change Period('NAT') to return NaT, not Period instance #12759
Labels
API Design
Clean
Missing-data
np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
Period
Period data type
Milestone
Code Sample, a copy-pastable example if possible
Timedelta
returnsNaT
when input can be regarded asNaT
. OtherwisePeriod
returns its special representation (This was done in #7485 prior toTimedelta
).Expected Output
The fix should affects:
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
) (Checking for NaT in PeriodIndex doesn't work with None, pd.NaT #13582)output of
pd.show_versions()
Current master.
The text was updated successfully, but these errors were encountered: