pandas resample documentation [closed]

Więc całkowicie rozumiem, jak używać resample , ale dokumentacja nie robi dobrej roboty wyjaśniając opcje.

Więc większość opcji w funkcji resample jest dość prosta, z wyjątkiem tych dwóch:

  • rule : offset string lub obiekt reprezentujący docelową konwersję
  • how: string, metoda down-or re-sampling, domyślnie "mean"

Więc patrząc na tyle przykładów, jakie znalazłem w Internecie, widzę dla Ciebie regułę mogę zrobić 'D' na dzień, 'xMin' na minuty, 'xL' na milisekundy, ale to wszystko, co znalazłem.

Za to, że widziałem następujące: 'first', np.max, 'last', 'mean', i 'n1n2n3n4...nx' gdzie nx jest pierwszą literą indeksu każdej kolumny.

Czy jest gdzieś w dokumentacji, której mi brakuje, która wyświetla każdą opcję dla reguły pandas.resample i jak ją wprowadzić? Jeśli tak, to gdzie, bo nie mogłem go znaleźć. Jeśli nie, jakie są dla nich wszystkie opcje?

Author: DBinJP, 2013-06-08

2 answers

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

Zobacz dokumentację timeseries . Zawiera listę offsetów (i 'zakotwiczonych' offsetów) oraz sekcję o resamplingu.

Zauważ, że nie ma listy wszystkich opcji how, ponieważ może to być dowolna funkcja tablicy NumPy, a każda funkcja dostępna przez groupby dispatching może być przekazana do how po nazwie.

 226
Author: Matti John,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2016-11-19 21:12:25

Jest w tym coś więcej niż to, ale prawdopodobnie szukasz tej listy:

B   business day frequency
C   custom business day frequency (experimental)
D   calendar day frequency
W   weekly frequency
M   month end frequency
BM  business month end frequency
MS  month start frequency
BMS 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
H   hourly frequency
T   minutely frequency
S   secondly frequency
L   milliseconds
U   microseconds

Źródło: http://pandas.pydata.org/pandas-docs/stable/timeseries.html#offset-aliases

 63
Author: vonkohorn,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2015-04-27 02:13:58