(self, keep_attrs, **kwargs)
| 193 | return method |
| 194 | |
| 195 | def _mean(self, keep_attrs, **kwargs): |
| 196 | result = self.sum(keep_attrs=False, **kwargs) |
| 197 | # use dtype of result for casting of count |
| 198 | # this allows for GH #7062 and GH #8864, fixes GH #10340 |
| 199 | result /= duck_array_ops.astype( |
| 200 | self.count(keep_attrs=False), dtype=result.dtype, copy=False |
| 201 | ) |
| 202 | if keep_attrs: |
| 203 | result.attrs = self.obj.attrs |
| 204 | |
| 205 | return result |
| 206 | |
| 207 | _mean.__doc__ = _ROLLING_REDUCE_DOCSTRING_TEMPLATE.format(name="mean") |
| 208 |