datetime 中毫秒的格式化代码¶
In [1]:
import datetime
datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S.%f')
Out[1]:
Pandas 中 timeindex 的毫秒¶
见 https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#dateoffset-objects
In [2]:
import pandas as pd
pd.date_range(datetime.datetime.now(), periods=5, freq='10L')
Out[2]: