-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
AstypeBugDtype ConversionsUnexpected or buggy dtype conversionsUnexpected or buggy dtype conversionsStringsString extension data type and string dataString extension data type and string dataTimedeltaTimedelta data typeTimedelta data type
Description
tdi = pd.timedelta_range("1 Day", periods=3)
ser = pd.Series(tdi)
>>> ser.astype("string")
0 1 days
1 2 days
2 3 days
dtype: string
>>> ser.astype("string").astype(ser.dtype)
[...]
ValueError: Could not convert object to NumPy timedelta
We have a round-trip test for string -> dt64 in test_astype_roundtrip, should amend that to do td64 when this is fixed
Metadata
Metadata
Assignees
Labels
AstypeBugDtype ConversionsUnexpected or buggy dtype conversionsUnexpected or buggy dtype conversionsStringsString extension data type and string dataString extension data type and string dataTimedeltaTimedelta data typeTimedelta data type