Closed
Description
Code Sample, a copy-pastable example if possible
>>> s = pd.Series(['x'])
>>> s['td'] = pd.Timedelta('9 days')
>>> s
0 x
td 777600000000000
dtype: object
# However, *if the key already exists*, it works as expected:
>>> s['td_2'] = 0
>>> s['td_2'] = pd.Timedelta('9 days')
>>> s
0 x
td 777600000000000
td_2 9 days 00:00:00
dtype: object
Problem description
Timedeltas should remain Timedeltas when inserted into object Series, particularly because they are nice to work with. 😅
Expected Output
>>> s = pd.Series(['x'])
>>> s['td'] = pd.Timedelta('9 days')
>>> s
0 x
td 9 days 00:00:00
dtype: object
Output of pd.show_versions()
pandas 0.23.3