-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Adding unixtime property to Timestamp and DatetimeIndex #45217
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
Conversation
pandas/_libs/tslibs/timestamps.pyx
Outdated
@@ -871,7 +886,13 @@ cdef class _Timestamp(ABCTimestamp): | |||
""" | |||
# GH 17329 | |||
# Note: Naive timestamps will not match datetime.stdlib | |||
return round(self.value / 1e9, 6) | |||
warnings.warn( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a stdlib method and should remain
""" | ||
# GH 17329 | ||
# Note: Naive timestamps will not match datetime.stdlib | ||
return round(self.value / 1e9, 6) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this rounded?
This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this. |
closing as stale. we would still take this if rebased & updated. pls ping to reopen if interested. |
This PR implements #43975 (#43975), adding a unixtime property to Timestamp and Datetime index.
In the course of developing this PR, I discovered that the Timestamp class already has a method called timestamp() which calculates a unixtime. I deprecated the timestamp method, as I found the name ambiguous (there's nothing about the phrase timestamp that leads me to think of unixtimes).
This is my first PR against pandas, so apologies for any violations of conventions for code or PRs.