A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pandas-dev/pandas/issues/10875 below:

Index name is not preserved during some conversions · Issue #10875 · pandas-dev/pandas · GitHub

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)

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4