6分钟
DatetimeIndex的方法
DatetimeIndex
的方法有:(DatetimeIndex
继承自Index
,因此它有Index
的所有方法)
indexer_at_time(time, asof=False)
:返回指定time
的位置indexer_between_time( start_time, end_time, include_start=True,
include_end=True)
:返回指定的两个时间之间的索引的位置normalize()
:将时间调整到午夜to_period( freq=None)
:以指定freq
转换到PeriodIndex
to_perioddelta( freq)
:计算不同索引值的Timedelta
,然后转换成一个TimedeldaIndex
to_pydatetime
/tz_convert
/tz_localize
:对每个时间使用Timestamp
对应的方法
任何Timestamp
的属性都可以作用于DatetimeIndex
。
学员评价