Skip to content
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

BUG: Series.apply(to_timedelta) returns object-type Series. #5458

Closed
danielballan opened this issue Nov 6, 2013 · 0 comments · Fixed by #5995

Comments

@danielballan
Copy link
Contributor

commented Nov 6, 2013

For later (post 0.13)...

Good:

In [1]: Series(['2013-01-05']).apply(pd.to_datetime)
Out[1]:
0   2013-01-05 00:00:00
dtype: datetime64[ns]

Bad:

In [2]: Series(['00:00:01']).apply(pd.to_timedelta)
Out[2]:
0    1000000000 nanoseconds
dtype: object

This problem turned up in #5438 , resovling #5437 . Refer to the discussion there.

See tseries/tests/test_timedeltas.py, specifically test_apply_to_timedelta. Currently, Lines 304 and 311 of the latter contain commented out assert statements that, after this is resolved should be uncommented and pass.

Also see tests/test_frame.py/test_operators_timedelta64.py.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.