-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Cythonized GroupBy Quantile #20405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cythonized GroupBy Quantile #20405
Changes from 1 commit
618ec99
74871d8
7b6ca68
31aff03
4a43815
eb18823
813da81
e152dd5
7a8fefb
b4938ba
3f7d0a9
d7aec3f
e712946
72cd30e
a3c4b11
ac96526
7d439d8
3047eed
70bf89a
02eb336
7c3c349
3b9c7c4
ad8b184
b846bc2
93b122c
09308d4
1a718f2
ff062bd
bdb5089
9b55fb5
31e66fc
41a734f
67e0f00
07b0c00
86aeb4a
86b9d8d
cfa1b45
00085d0
1f02532
3c64c1f
09695f5
68cfed9
4ce1448
5e840da
7969fb6
f9a8317
464a831
4b3f9be
b996e1d
cdd8985
64f46a3
4d88e8a
1cd93dd
9ae23c1
eb99f07
94d4892
0512f37
2370129
a018570
f41cd05
21691bb
082aea3
dc5877a
7496a9b
ec013bf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1724,7 +1724,7 @@ def quantile(self, q=0.5, interpolation='linear'): | |
""" | ||
|
||
def pre_processor(vals): | ||
# type: np.ndarray -> (np.ndarray, typing.Type) | ||
# type: np.ndarray -> (np.ndarray, Optional[typing.Type]) | ||
if is_object_dtype(vals): | ||
raise TypeError("'quantile' cannot be performed against " | ||
"'object' dtypes!") | ||
|
@@ -1739,7 +1739,7 @@ def pre_processor(vals): | |
return vals, inference | ||
|
||
def post_processor(vals, inference): | ||
# type: (np.ndarray, typing.Type) -> np.ndarray | ||
# type: (np.ndarray, Optional[typing.Type]) -> np.ndarray | ||
if inference: | ||
# Check for edge case | ||
if not (is_integer_dtype(inference) and | ||
|
@@ -1995,14 +1995,14 @@ def _get_cythonized_result(self, how, grouper, aggregate=False, | |
pre_processing : function, default None | ||
Function to be applied to `values` prior to passing to Cython. | ||
Function should return a tuple where the first element is the | ||
values to be passed to Cython and the second element is an | ||
optional dictionary containing type inferences to be applied | ||
after the Cython call. Raises if `needs_values` is False | ||
values to be passed to Cython and the second element is an optional | ||
type which the values should be converted to after being returned | ||
by the Cython operation. Raises if `needs_values` is False. | ||
post_processing : function, default None | ||
Function to be applied to result of Cython function. Should accept | ||
an array of values as the first argument and type inferences as its | ||
second argument, i.e. the signature should be | ||
(ndarray, Dict[str, typing.Type]). | ||
(ndarray, typing.Type). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not really what I meant, this is a (ndarray, dict) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well on a second pass the dict was unnecessary so I ended up just returning the type. I suppose it could either be an actual type object or a string so this is an approximation of that for simplicity, though could update to include a string as well |
||
**kwargs : dict | ||
Extra arguments to be passed back to Cython funcs | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.