-
-
Notifications
You must be signed in to change notification settings - Fork 18k
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
ENH: Add unit keyword to Timestamp and to_datetime #3818
Conversation
(I wonder if it makes it less ambiguous here to have the default unit for |
they are both treated the same (but i'll change it in any event) |
actually...going to leav e it as None, becuase it doens' tapply in most cases and might be confusing? |
I was thinking that too, but I think a little rewording may solve it, I was going to suggest something like:
|
ok...that's reasonable....sure |
@wesm any thoughts? |
This used to cause an exception, but maybe now is a good time for this to return NaT? :) In your branch:
|
think I got all of the cases, thanks!
|
@wesm ok API by you? |
integers or floats that are in an epoch unit of s, ms, us, ns (e.g. unix timestamps or epoch s, with fracional seconds allowed) (GH 3540)
TST: manage truediv in py3 for unit comparisons
ENH: Add unit keyword to Timestamp and to_datetime
@@ -69,6 +69,8 @@ def to_datetime(arg, errors='ignore', dayfirst=False, utc=None, box=True, | |||
format : string, default None | |||
strftime to parse time, eg "%d/%m/%Y" | |||
coerce : force errors to NaT (False by default) | |||
unit : unit of the arg (s,ms,us,ns) denote the unit in epoch |
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.
Think maybe this should say "unit of the arg (s,ms,us,ns) if passed an epoch", will do that in that pr
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.
go ahed....just merged
to enable passing of integers or floats that are in an epoch unit of s, ms, us, ns
(e.g. unix timestamps or epoch s, with fracional seconds allowed)
closes #3540