我是Pandas的新手,正在尝试使用date_range
。我遇到了各种各样的美好事物freq
,例如BME
和BMS
而且我希望能够快速查找适当的字符串以得到我想要的东西。昨天我在文档中的某个地方找到了一个格式良好的表,但是该表的标题太钝了,以至于我今天无法使用搜索再次找到它。
Answers:
您可以找到它称为Offset Aliases:
为有用的通用时间序列频率提供了许多字符串别名。我们将这些别名称为偏移别名。
Alias Description
B business day frequency
C custom business day frequency
D calendar day frequency
W weekly frequency
M month end frequency
SM semi-month end frequency (15th and end of month)
BM business month end frequency
CBM custom business month end frequency
MS month start frequency
SMS semi-month start frequency (1st and 15th)
BMS business month start frequency
CBMS custom business month start frequency
Q quarter end frequency
BQ business quarter end frequency
QS quarter start frequency
BQS business quarter start frequency
A, Y year end frequency
BA, BY business year end frequency
AS, YS year start frequency
BAS, BYS business year start frequency
BH business hour frequency
H hourly frequency
T, min minutely frequency
S secondly frequency
L, ms milliseconds
U, us microseconds
N nanoseconds
pd.tseries.offsets.__all__
您可以在此处查看所有有效的时间增量:pandas.pydata.org/pandas-docs/version/0.23.4/genic/…–