We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ce86c30 commit ce38e6fCopy full SHA for ce38e6f
doc/source/computation.rst
@@ -205,6 +205,17 @@ sugar for applying the moving window operator to all of the DataFrame's columns:
205
@savefig rolling_mean_frame.png width=4.5in
206
rolling_sum(df, 60).plot(subplots=True)
207
208
+The ``rolling_apply`` function takes an extra ``func`` argument and performs
209
+generic rolling computations. The ``func`` argument should be a single function
210
+that produces a single value from an ndarray input. Suppose we wanted to
211
+compute the mean absolute deviation on a rolling basis:
212
+
213
+.. ipython:: python
214
215
+ mad = lambda x: np.fabs(x - x.mean()).mean()
216
+ @savefig rolling_apply_ex.png width=4.5in
217
+ rolling_apply(ts, 60, mad).plot(style='k')
218
219
.. _stats.moments.binary:
220
221
Binary rolling moments
0 commit comments