Closed
Description
The issue is existing name of Index
is dropped during conversion to either TimedeltaIndex
or DatetimeIndex
.
In [42]: vec = ['01:02:03', '01:02:04']
In [43]: i = pd.Index(vec, name='label')
In [44]: i
Out[44]: Index(['01:02:03', '01:02:04'], dtype='object', name='label')
In [45]: pd.to_datetime(i)
Out[45]: DatetimeIndex(['2015-08-21 01:02:03', '2015-08-21 01:02:04'], dtype='datetime64[ns]', freq=None, tz=None)
In [46]: pd.to_timedelta(i)
Out[46]: TimedeltaIndex(['01:02:03', '01:02:04'], dtype='timedelta64[ns]', freq=None)