|
5 | 5 | from collections import defaultdict |
6 | 6 | from datetime import timedelta |
7 | 7 | from textwrap import dedent |
| 8 | +from typing import Set |
8 | 9 | import warnings |
9 | 10 |
|
10 | 11 | import numpy as np |
|
42 | 43 | class _Window(PandasObject, SelectionMixin): |
43 | 44 | _attributes = ['window', 'min_periods', 'center', 'win_type', |
44 | 45 | 'axis', 'on', 'closed'] |
45 | | - exclusions = set() |
| 46 | + exclusions = set() # type: Set[str] |
46 | 47 |
|
47 | 48 | def __init__(self, obj, window=None, min_periods=None, |
48 | 49 | center=False, win_type=None, axis=0, on=None, closed=None, |
@@ -305,10 +306,10 @@ def _center_window(self, result, window): |
305 | 306 | result = np.copy(result[tuple(lead_indexer)]) |
306 | 307 | return result |
307 | 308 |
|
308 | | - def aggregate(self, arg, *args, **kwargs): |
309 | | - result, how = self._aggregate(arg, *args, **kwargs) |
| 309 | + def aggregate(self, func, *args, **kwargs): |
| 310 | + result, how = self._aggregate(func, *args, **kwargs) |
310 | 311 | if result is None: |
311 | | - return self.apply(arg, raw=False, args=args, kwargs=kwargs) |
| 312 | + return self.apply(func, raw=False, args=args, kwargs=kwargs) |
312 | 313 | return result |
313 | 314 |
|
314 | 315 | agg = aggregate |
@@ -788,7 +789,7 @@ def __init__(self, obj, *args, **kwargs): |
788 | 789 | corr = GroupByMixin._dispatch('corr', other=None, pairwise=None) |
789 | 790 | cov = GroupByMixin._dispatch('cov', other=None, pairwise=None) |
790 | 791 |
|
791 | | - def _apply(self, func, name, window=None, center=None, |
| 792 | + def _apply(self, func, name=None, window=None, center=None, |
792 | 793 | check_minp=None, **kwargs): |
793 | 794 | """ |
794 | 795 | Dispatch to apply; we are stripping all of the _apply kwargs and |
|
0 commit comments