Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
BUG: boxing Timedeltas on .apply #11349
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: float64You're seeing that result with |
@amelio-vazquez-reina the reason we don't support
so
So this is a bug here pull-requests welcome! |
amelio-vazquez-reina commentedOct 16, 2015
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
applywould run the function I pass it item by item in the series. Why doestotal_seconds()work for a single item, but not withapply?