pandas.Series.dt .微秒 #

系列.dt。微秒[来源] #

每个元素的微秒数(>= 0 且小于 1 秒)。

例子

对于系列:

>>> ser = pd.Series(pd.to_timedelta([1, 2, 3], unit='us'))
>>> ser
0   0 days 00:00:00.000001
1   0 days 00:00:00.000002
2   0 days 00:00:00.000003
dtype: timedelta64[ns]
>>> ser.dt.microseconds
0    1
1    2
2    3
dtype: int32

对于 TimedeltaIndex:

>>> tdelta_idx = pd.to_timedelta([1, 2, 3], unit='us')
>>> tdelta_idx
TimedeltaIndex(['0 days 00:00:00.000001', '0 days 00:00:00.000002',
                '0 days 00:00:00.000003'],
               dtype='timedelta64[ns]', freq=None)
>>> tdelta_idx.microseconds
Index([1, 2, 3], dtype='int32')