API: Change Period('NAT') to return NaT, not Period instance · Issue #12759 · pandas-dev/pandas (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

@sinhrks

Description

@sinhrks

Code Sample, a copy-pastable example if possible

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:

output of pd.show_versions()

Current master.