-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: boxing Timedeltas on .apply #11349
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
Comments
As outlined in the docs the way to do conversions is via In [8]: s.astype('m8[h]')
Out[8]:
0 1824
1 -360
2 552
3 1824
4 1824
5 1824
6 1824
7 1392
8 8400
9 360
10 1824
11 -384
Name: 1, dtype: float64
In [9]: s / np.timedelta64(1, 'h')
Out[9]:
0 1824
1 -360
2 552
3 1824
4 1824
5 1824
6 1824
7 1392
8 8400
9 360
10 1824
11 -384
Name: 1, dtype: float64 You're seeing that result with |
@amelio-vazquez-reina the reason we don't support
so
So this is a bug here pull-requests welcome! |
Consider the following Series:
I am hoping to convert the above to hours.
If I do:
I get:
What's even more strange is that if I do:
it works for one element, but if I do:
I get:
I thought
apply
would run the function I pass it item by item in the series. Why doestotal_seconds()
work for a single item, but not withapply
?The text was updated successfully, but these errors were encountered: