Skip to content
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

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

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

Comments

Projects
None yet
2 participants
@sinhrks
Copy link
Member

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:

  • Period and PeriodIndex, Series ops
    • add, sub, comp
  • PeriodIndex creation from list-like which contains Period and NaT (#13430)
  • PeriodIndex boxing
  • .to_period
  • __contains__ any NaT-like(pd.NaT, None, float('nan'), np.nan) (#13582)

output of pd.show_versions()

Current master.

@jreback

This comment has been minimized.

Copy link
Contributor

commented Mar 31, 2016

yep, looks good.

@sinhrks sinhrks referenced this issue Jun 12, 2016

Closed

ENH: PeriodIndex now accepts pd.NaT #13430

3 of 3 tasks complete

jreback added a commit that referenced this issue Jun 14, 2016

ENH: PeriodIndex now accepts pd.NaT
Related to #12759.

Author: sinhrks <sinhrks@gmail.com>

Closes #13430 from sinhrks/period_nat and squashes the following commits:

5990de6 [sinhrks] ENH: PeriodIndex now accepts pd.NaT

@sinhrks sinhrks modified the milestones: 0.19.0, 0.20.0 Jul 10, 2016

@sinhrks sinhrks referenced this issue Jul 10, 2016

Closed

API: Change Period('NAT') to return NaT #13609

10 of 10 tasks complete

@jreback jreback closed this in 0a70b5f Jul 15, 2016

@sinhrks sinhrks referenced this issue Jul 21, 2016

Merged

TST/BUG: Added more tests for Period(NaT) #13737

4 of 4 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.