-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
Any way to change datetime64 resolution? #6741
Comments
Well you are actually looking for this.
We don't allow direct conversions because its simply too complicated to keep anything other than This is currently NotImplemented, but is very straightforward to do.
Could also support I'll mark this as an enhancement Want to submit a PR? |
Yes! That's what I'm looking for. But what would the result be, if you want to keep everything in timedelta64[ns] internally? I understand the motivation for keeping the code simple. Personally, I am really sold on numpy's support for timestamps with varying precision. |
result would be the same as above only thing that makes sense |
what are u using this for? |
I'm loading data on/off an embedded device and also serving visualizations of said data. I'm using minutes since epoch as my time representation since that is a reasonable precision for me and fits into a 32-bit int. |
BTW I am impressed not only with the speed of pandas, but also by the speed with which you respond to issues here. |
thanks to_json can do thing like this FYI |
See also: #4338 |
is this (i.e. internally all is in nanoseconds) the reason why a timedelta[s] does not display correctly? |
@michaelaye #8184 will convert this properly |
this is essentially covered by #7307 so going to close this in favor of that if internal resolution is changed (then this will be possible) |
xref to #7307
Converting from
datetime64[ns]
todatetime64[m]
is disallowed, as mentioned in issue #3416, apparently because of a numpy bug. It looks to me like numpy does this correctly, however. It would be nice if this could work without resorting to raw numpy arrays:My other workaround, which is slightly less clumsy, is do just convert manually, since casting to int64 is permitted:
But it'd be nicer not to have to do all that.
The text was updated successfully, but these errors were encountered: