Timedelta
returns NaT
when input can be regarded as NaT
. Otherwise Period
returns its special representation (This was done in #7485 prior to Timedelta
).
pd.Timedelta('NaT')
# NaT
pd.Period('NaT', freq='M')
# Period('NaT', 'M')
Expected Output
pd.Period('NaT', freq='M')
# NaT
The fix should affects:
Period
and PeriodIndex
, Series
ops
PeriodIndex
creation from list-like which contains Period
and NaT
( 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)pd.show_versions()
Current master.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4