熊猫的‘ Freq’标签中哪些值是有效的?

我是新的熊猫,并试图使用 date_range。我遇到了各种各样的好东西为 freq,如 BMEBMS,我想能够迅速查找适当的字符串,以获得我想要的。昨天我在文档的某个地方找到了一个格式很好的表格,但是表格的标题太钝了,我今天不能再用搜索找到它了。

熊猫的‘ Freq’标签中哪些值是有效的?

71800 次浏览

你可以找到它叫做 抵消别名:

一些字符串别名给出了有用的共同时间序列频率。我们将这些别名称为偏移量别名。

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