@@ -12,6 +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 Optional , Type
15
16
import warnings
16
17
17
18
import numpy as np
@@ -1040,7 +1041,7 @@ def _bool_agg(self, val_test, skipna):
1040
1041
"""
1041
1042
1042
1043
def objs_to_bool (vals ):
1043
- # type: (np.ndarray) -> (np.ndarray, typing. Type)
1044
+ # type: (np.ndarray) -> (np.ndarray, Type)
1044
1045
if is_object_dtype (vals ):
1045
1046
vals = np .array ([bool (x ) for x in vals ])
1046
1047
else :
@@ -1049,7 +1050,7 @@ def objs_to_bool(vals):
1049
1050
return vals .view (np .uint8 ), np .bool
1050
1051
1051
1052
def result_to_bool (result , inference ):
1052
- # type: (np.ndarray, typing. Type) -> np.ndarray
1053
+ # type: (np.ndarray, Type) -> np.ndarray
1053
1054
return result .astype (inference , copy = False )
1054
1055
1055
1056
return self ._get_cythonized_result ('group_any_all' , self .grouper ,
@@ -1738,7 +1739,7 @@ def quantile(self, q=0.5, interpolation='linear'):
1738
1739
"""
1739
1740
1740
1741
def pre_processor (vals ):
1741
- # type: (np.ndarray) -> (np.ndarray, Optional[typing. Type])
1742
+ # type: (np.ndarray) -> (np.ndarray, Optional[Type])
1742
1743
if is_object_dtype (vals ):
1743
1744
raise TypeError ("'quantile' cannot be performed against "
1744
1745
"'object' dtypes!" )
@@ -1753,7 +1754,7 @@ def pre_processor(vals):
1753
1754
return vals , inference
1754
1755
1755
1756
def post_processor (vals , inference ):
1756
- # type: (np.ndarray, Optional[typing. Type]) -> np.ndarray
1757
+ # type: (np.ndarray, Optional[Type]) -> np.ndarray
1757
1758
if inference :
1758
1759
# Check for edge case
1759
1760
if not (is_integer_dtype (inference ) and
@@ -2016,7 +2017,7 @@ def _get_cythonized_result(self, how, grouper, aggregate=False,
2016
2017
Function to be applied to result of Cython function. Should accept
2017
2018
an array of values as the first argument and type inferences as its
2018
2019
second argument, i.e. the signature should be
2019
- (ndarray, typing. Type).
2020
+ (ndarray, Type).
2020
2021
**kwargs : dict
2021
2022
Extra arguments to be passed back to Cython funcs
2022
2023
0 commit comments