Skip to content

Commit b9f826f

Browse files
jorisvandenbosschejreback
authored andcommitted
DOC: use apply(raw=True) in docs to silence warning (#20741)
1 parent 7ed1f53 commit b9f826f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

doc/source/computation.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ compute the mean absolute deviation on a rolling basis:
323323
324324
mad = lambda x: np.fabs(x - x.mean()).mean()
325325
@savefig rolling_apply_ex.png
326-
s.rolling(window=60).apply(mad).plot(style='k')
326+
s.rolling(window=60).apply(mad, raw=True).plot(style='k')
327327
328328
.. _stats.rolling_window:
329329

doc/source/cookbook.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ Unlike agg, apply's callable is passed a sub-DataFrame which gives you access to
496496
def Red(x):
497497
return functools.reduce(CumRet,x,1.0)
498498
499-
S.expanding().apply(Red)
499+
S.expanding().apply(Red, raw=True)
500500
501501
502502
`Replacing some values with mean of the rest of a group

0 commit comments

Comments
 (0)