What are Pandas "expanding window" functions? -
pandas documentation lists bunch of "expanding window functions" :
http://pandas.pydata.org/pandas-docs/version/0.17.0/api.html#standard-expanding-window-functions
but couldn't figure out documentation. equivalent rolling functions, dropping na values?
you may want read this pandas docs:
a common alternative rolling statistics use expanding window, yields value of statistic all data available point in time.
these follow similar interface .rolling, .expanding method returning expanding object.
as these calculations special case of rolling statistics, implemented in pandas such following 2 calls equivalent:
in [96]: df.rolling(window=len(df), min_periods=1).mean()[:5] out[96]: b c d 2000-01-01 0.314226 -0.001675 0.071823 0.892566 2000-01-02 0.654522 -0.171495 0.179278 0.853361 2000-01-03 0.708733 -0.064489 -0.238271 1.371111 2000-01-04 0.987613 0.163472 -0.919693 1.566485 2000-01-05 1.426971 0.288267 -1.358877 1.808650 in [97]: df.expanding(min_periods=1).mean()[:5] out[97]: b c d 2000-01-01 0.314226 -0.001675 0.071823 0.892566 2000-01-02 0.654522 -0.171495 0.179278 0.853361 2000-01-03 0.708733 -0.064489 -0.238271 1.371111 2000-01-04 0.987613 0.163472 -0.919693 1.566485 2000-01-05 1.426971 0.288267 -1.358877 1.808650
Comments
Post a Comment