熊猫“ Freq”标签的文档在哪里?[关闭]


91

我是Pandas的新手,正在尝试使用date_range。我遇到了各种各样的美好事物freq,例如BMEBMS而且我希望能够快速查找适当的字符串以得到我想要的东西。昨天我在文档中的某个地方找到了一个格式良好的表,但是该表的标题太钝了,以至于我今天无法使用搜索再次找到它。

Answers:


139

您可以找到它称为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

11
谢谢!我知道这是我永远不会搜索的术语-“偏移别名”!如果freq参数将其期望值描述为“偏移别名”,则对新手会有所帮助。
sundowner

谢谢。我特别注意以下几点:
sundowner

1
在pandas模块中是否有一个包含偏移字符串列表的变量?
BallpointBen19年

1
您可以在此处查看所有偏移值:pd.tseries.offsets.__all__ 您可以在此处查看所有有效的时间增量:pandas.pydata.org/pandas-docs/version/0.23.4/genic/…–
jackalack
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.