ENH: add Timestamp.to_datetime64 by shoyer · Pull Request #9255 · pandas-dev/pandas (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation8 Commits1 Checks0 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

@shoyer

This PR adds a Timestamp.to_datetime64() method to complement the Timedelta.to_timedelta64() method I added in #8884. It is a continuation of the aborted #8916.

Arguably, there should also be the alias Timestamp.values to complement the series property but I haven't added that yet.

@jreback

hmm, its called Timestamp.value; you think .values should also be there? why? (its not a big deal, but curious why)

@shoyer

Timstamp.value is an integer; .values would be a np.datetime64 object, like the datetime64 .values on arrays.

@jreback

@shoyer

Any comments on this PR? (Tests are green)

jreback

Choose a reason for hiding this comment

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

add the issue as a comment here

@jreback

trivial comment. looks good otherwise. you are picking up pieces from those other pr's yes?

@shoyer

@shoyer

@jreback By other PRs do you mean #8916? Yes, probably, eventually. Not entirely sure it's possible though given numpy datetime64 limitations :).

I wrote this one because I need it for the next PR I'm submitting tonight.

@jreback

@shoyer yep. you had some good stuff in there IIRC.

shoyer added a commit that referenced this pull request

Jan 15, 2015

@shoyer

ENH: add Timestamp.to_datetime64

Labels

2 participants

@shoyer @jreback