6分钟
PeriodIndex
如果将一个Period
序列作为索引,则该索引就是PeriodIndex
类型。其各位置的值为Period
对象。
pd.PeriodIndex(data=None, ordinal=None, freq=None, start=None, end=None,
periods=None, copy=False, name=None, tz=None, dtype=None, **kwargs)
data
:一个array-like
对象,给出了各个时间段copy
:一个布尔值,如果为True
则拷贝基础数据freq
:一个字符串或者period
对象,给出了频率start
:一个period-like
,指定了起始时间段。如果data=None
,则使用它来生成时间段periods
:一个整数(大于0),指定生成多少个时间段。如果data=None
,则使用它来生成时间段end
:一个period-like
,指定了结束时间段。如果data=None
且periods=None
,则使用它来生成时间段year/month/quarter/day/hour/minute/second
:一个整数、array
或者Series
。通过它们可以组装出一个Period
序列。tz
: 一个字符串,指定了时区。如果非空,则返回的是localized DatetimeIndex
name
:指定了Index
的名字
学员评价