@@ -1040,17 +1040,15 @@ def _bool_agg(self, val_test, skipna):
1040
1040
Shared func to call any / all Cython GroupBy implementations.
1041
1041
"""
1042
1042
1043
- def objs_to_bool (vals ):
1044
- # type: (np.ndarray) -> (np.ndarray, Type)
1043
+ def objs_to_bool (vals : np .ndarray ) -> types .Tuple [np .ndarray , Type ]:
1045
1044
if is_object_dtype (vals ):
1046
1045
vals = np .array ([bool (x ) for x in vals ])
1047
1046
else :
1048
1047
vals = vals .astype (np .bool )
1049
1048
1050
1049
return vals .view (np .uint8 ), np .bool
1051
1050
1052
- def result_to_bool (result , inference ):
1053
- # type: (np.ndarray, Type) -> np.ndarray
1051
+ def result_to_bool (result : np .ndarray , inference : Type ) -> np .ndarray :
1054
1052
return result .astype (inference , copy = False )
1055
1053
1056
1054
return self ._get_cythonized_result ('group_any_all' , self .grouper ,
@@ -1738,8 +1736,8 @@ def quantile(self, q=0.5, interpolation='linear'):
1738
1736
b 3.0
1739
1737
"""
1740
1738
1741
- def pre_processor (vals ):
1742
- # type: (np.ndarray) -> ( np.ndarray, Optional[Type])
1739
+ def pre_processor (vals : np . ndarray ) -> \
1740
+ types . Tuple [ np .ndarray , Optional [Type ]]:
1743
1741
if is_object_dtype (vals ):
1744
1742
raise TypeError ("'quantile' cannot be performed against "
1745
1743
"'object' dtypes!" )
@@ -1753,8 +1751,8 @@ def pre_processor(vals):
1753
1751
1754
1752
return vals , inference
1755
1753
1756
- def post_processor (vals , inference ):
1757
- # type: (np.ndarray, Optional[Type]) -> np.ndarray
1754
+ def post_processor (vals : np . ndarray , inference : Optional [ Type ]) -> \
1755
+ np .ndarray :
1758
1756
if inference :
1759
1757
# Check for edge case
1760
1758
if not (is_integer_dtype (inference ) and
0 commit comments