pandas.DatetimeIndex.to_series

DatetimeIndex.to_series(keep_tz=False)

Create a Series with both index and values equal to the index keys useful with map for returning an indexer based on an index

Parameters :

keep_tz : optional, defaults False.

return the data keeping the timezone.

If keep_tz is True:

If the timezone is not set or is UTC, the resulting Series will have a datetime64[ns] dtype. Otherwise the Series will have an object dtype.

If keep_tz is False:

Series will have a datetime64[ns] dtype.

Returns :

Series