@@ -12,7 +12,7 @@ class providing the base-class of operations.
12
12
import datetime
13
13
from functools import partial , wraps
14
14
import types
15
- from typing import FrozenSet , List , Optional , Tuple , Type , Union
15
+ from typing import Dict , FrozenSet , List , Optional , Tuple , Type , Union
16
16
17
17
import numpy as np
18
18
@@ -849,7 +849,7 @@ def _transform_should_cast(self, func_nm):
849
849
)
850
850
851
851
def _cython_transform (self , how , numeric_only = True , ** kwargs ):
852
- output = collections .OrderedDict ()
852
+ output : Dict = collections .OrderedDict ()
853
853
for name , obj in self ._iterate_slices ():
854
854
is_numeric = is_numeric_dtype (obj .dtype )
855
855
if numeric_only and not is_numeric :
@@ -2259,7 +2259,7 @@ def _get_cythonized_result(
2259
2259
)
2260
2260
2261
2261
labels , _ , ngroups = grouper .group_info
2262
- output = collections .OrderedDict ()
2262
+ output : Dict = collections .OrderedDict ()
2263
2263
base_func = getattr (libgroupby , how )
2264
2264
2265
2265
for name , obj in self ._iterate_slices ():
@@ -2502,7 +2502,8 @@ def _reindex_output(self, output):
2502
2502
2503
2503
2504
2504
@Appender (GroupBy .__doc__ )
2505
- def groupby (obj , by , ** kwds ):
2505
+ def groupby (obj : Union [Series , DataFrame ], by , ** kwds ) -> GroupBy :
2506
+ klass : Type [GroupBy ]
2506
2507
if isinstance (obj , Series ):
2507
2508
from pandas .core .groupby .generic import SeriesGroupBy
2508
2509
0 commit comments