Skip to content

API: Change Period('NAT') to return NaT, not Period instance #12759

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

Closed
1 of 6 tasks
sinhrks opened this issue Mar 31, 2016 · 1 comment
Closed
1 of 6 tasks

API: Change Period('NAT') to return NaT, not Period instance #12759

sinhrks opened this issue Mar 31, 2016 · 1 comment
Labels
API Design Clean Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate Period Period data type
Milestone

Comments

@sinhrks
Copy link
Member

sinhrks commented Mar 31, 2016

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.

@sinhrks sinhrks added Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate API Design Period Period data type Clean labels Mar 31, 2016
@sinhrks sinhrks added this to the 0.19.0 milestone Mar 31, 2016
@jreback
Copy link
Contributor

jreback commented Mar 31, 2016

yep, looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Design Clean Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate Period Period data type
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants