DatetimeIndex.to_series()

pandas.DatetimeIndex.to_series

DatetimeIndex.to_series(keep_tz=False) [source]

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, the resulting Series will have a datetime64[ns] dtype.

Otherwise the Series will have an datetime64[ns, tz] dtype; the tz will be preserved.

If keep_tz is False:

Series will have a datetime64[ns] dtype. TZ aware objects will have the tz removed.

Returns:

Series

© 2008–2012, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
Licensed under the 3-clause BSD License.
http://pandas.pydata.org/pandas-docs/version/0.20.2/generated/pandas.DatetimeIndex.to_series.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部