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 DatetimeIndexname:指定了Index的名字
学员评价