python - Pandas 'Freq' 标签中的有效值是什么?

标签 python pandas documentation dataframe frequency

我是 Pandas 的新手,正在尝试使用 date_range。我遇到了 freq 的各种好东西,例如 BMEBMS,我希望能够快速查找正确的字符串得到我想要的。昨天我在文档的某个地方找到了一个格式很好的表格,但是表格的标题太迟钝了,我今天无法使用搜索再次找到它。

什么值在 Pandas 'Freq' 标签中是有效的?

最佳答案

你可以找到它叫 Offset Aliases :

A number of string aliases are given to useful common time series frequencies. We will refer to these aliases as 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

关于python - Pandas 'Freq' 标签中的有效值是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35339139/

相关文章:

javascript - 如何记录 JavaScript/CoffeeScript 数据结构

python - 如何将 python 列表插入到 Postgres 表中

python - Cython:为什么 NumPy 数组需要类型转换为对象?

python - 使用!=获得python while语句

python-3.x - 如何删除包含空列表的数据框中的行?

python - Pandas 逻辑运算

Python:内存泄漏调试

python - 如何混合pandas和beautifulsoup从xml文件目录中提取一些元素标签?

java - 我在 Javadoc 中与谁交谈?

c# - 如何在 C# WinForms 中实现程序内文档?