大 pandas resample文件 [英] pandas resample documentation

查看:261
本文介绍了大 pandas resample文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我完全了解如何使用重新采样,但是文档并不能很好地解释选项。

So I completely understand how to use resample, but the documentation does not do a good job explaining the options.

所以 resample 函数中的大多数选项都很直接除了这两个:

So most options in the resample function are pretty straight forward except for these two:


  • 规则:表示目标转换的偏移字符串或对象

  • 如何:字符串,下采样或重采样的方法,默认为平均值

我可以看到规则,你可以做一些'D'一天,'xMin'分钟,'xL'为毫秒,但这是我可以找到的。

So from looking at as many examples as I found online I can see for rule you can do 'D' for day, 'xMin' for minutes, 'xL' for milliseconds, but that is all I could find.

为了看到以下内容:'first' np.max 'last''mean''n1n2n3n4 ... nx'其中nx是每列的第一个字母dex。

for how I have seen the following: 'first', np.max, 'last', 'mean', and 'n1n2n3n4...nx' where nx is the first letter of each column index.

所以在文档中有一些我错过的内容显示 pandas.resample '的每个选项规则和投入如何?如果是的话,那里是因为找不到。如果没有,他们的所有选项是什么?

So is there somewhere in the documentation that I am missing that displays every option for pandas.resample's rule and how inputs? If yes, where because I could not find it. If no, what are all the options for them?

推荐答案

B       business day frequency
C       custom business day frequency (experimental)
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 endfrequency
QS      quarter start frequency
BQS     business quarter start frequency
A       year end frequency
BA      business year end frequency
AS      year start frequency
BAS     business year start frequency
BH      business hour frequency
H       hourly frequency
T       minutely frequency
S       secondly frequency
L       milliseonds
U       microseconds
N       nanoseconds

请参阅时间表文档。它包括偏移量列表(和'anchored'offsets ),以及关于resampling

See the timeseries documentation. It includes a list of offsets (and 'anchored' offsets), and a section about resampling.

请注意,没有列出所有不同的如何选项,因为它可以是任何NumPy数组功能和通过 groupby dispatching 可用的任何功能都可以传递给如何按名称。

Note that there isn't a list of all the different how options, because it can be any NumPy array function and any function that is available via groupby dispatching can be passed to how by name.

这篇关于大 pandas resample文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆