diff --git a/doc/source/computation.rst b/doc/source/computation.rst index 4285767654e25..ff06c369e1897 100644 --- a/doc/source/computation.rst +++ b/doc/source/computation.rst @@ -323,7 +323,7 @@ compute the mean absolute deviation on a rolling basis: mad = lambda x: np.fabs(x - x.mean()).mean() @savefig rolling_apply_ex.png - s.rolling(window=60).apply(mad).plot(style='k') + s.rolling(window=60).apply(mad, raw=True).plot(style='k') .. _stats.rolling_window: diff --git a/doc/source/cookbook.rst b/doc/source/cookbook.rst index 4e61228d5c0ad..893642410af02 100644 --- a/doc/source/cookbook.rst +++ b/doc/source/cookbook.rst @@ -496,7 +496,7 @@ Unlike agg, apply's callable is passed a sub-DataFrame which gives you access to def Red(x): return functools.reduce(CumRet,x,1.0) - S.expanding().apply(Red) + S.expanding().apply(Red, raw=True) `Replacing some values with mean of the rest of a group