Skip to content

Period accepts datetime64 value #9869

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
wants to merge 1 commit into from

Conversation

jcrist
Copy link
Contributor

@jcrist jcrist commented Apr 13, 2015

Added support for datetime64 value for Period. Fixes #9054.

@jreback jreback added Bug Period Period data type labels Apr 13, 2015
@jreback jreback added this to the 0.16.1 milestone Apr 13, 2015
@@ -226,7 +226,9 @@ def test_period_constructor(self):

i1 = Period(date(2007, 1, 1), freq='M')
i2 = Period(datetime(2007, 1, 1), freq='M')
i3 = Period(np.datetime64('2007-01-01'), freq='M')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add a couple of more tests that have different numpy units,

e.g.

In [3]: np.datetime64('2007-01-01 00:00:00',dtype='M8[s]').dtype
Out[3]: dtype('<M8[s]')

@jreback
Copy link
Contributor

jreback commented Apr 13, 2015

pls add a release note as wel, looks good otherwise.

@cpcloud
Copy link
Member

cpcloud commented Apr 13, 2015

+1, will be awhile for travis, lots of PRs today :)

@jreback
Copy link
Contributor

jreback commented Apr 13, 2015

can you squash into a single commit. pls ping when done.

Added support for `datetime64` value for Period. Fixes pandas-dev#9054.
@jcrist
Copy link
Contributor Author

jcrist commented Apr 13, 2015

@jreback : squashed.

@cpcloud
Copy link
Member

cpcloud commented Apr 14, 2015

closing in favor of #9896

@cpcloud cpcloud closed this Apr 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Period Period data type
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ENH: Period to accept datetime64 value?
3 participants