Skip to content

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

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

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

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

danielballan opened this issue Nov 6, 2013 · 0 comments · Fixed by #5995
Labels
Dtype Conversions Unexpected or buggy dtype conversions Timedelta Timedelta data type
Milestone

Comments

@danielballan
Copy link
Contributor

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
Labels
Dtype Conversions Unexpected or buggy dtype conversions Timedelta Timedelta data type
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant