Skip to content

SeriesGroupBy.quantile doesn't work for nullable integers #33136

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

Closed
dsaxton opened this issue Mar 29, 2020 · 0 comments · Fixed by #33138
Closed

SeriesGroupBy.quantile doesn't work for nullable integers #33136

dsaxton opened this issue Mar 29, 2020 · 0 comments · Fixed by #33138
Labels
Bug Groupby NA - MaskedArrays Related to pd.NA and nullable extension arrays
Milestone

Comments

@dsaxton
Copy link
Member

dsaxton commented Mar 29, 2020

import pandas as pd

df = pd.DataFrame(
    {"a": ["x", "x", "y", "y"], "b": pd.array([1, 2, 3, 4], dtype="Int64")}
)
df.groupby("a")["b"].quantile(0.5)

raises

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-1-ef27f953b945> in <module>
      4     {"a": ["x", "x", "y", "y"], "b": pd.array([1, 2, 3, 4], dtype="Int64")}
      5 )
----> 6 df.groupby("a")["b"].quantile(0.5)

~/opt/miniconda3/lib/python3.7/site-packages/pandas/core/groupby/groupby.py in quantile(self, q, interpolation)
   1911                 post_processing=post_processor,
   1912                 q=q,
-> 1913                 interpolation=interpolation,
   1914             )
   1915         else:

~/opt/miniconda3/lib/python3.7/site-packages/pandas/core/groupby/groupby.py in _get_cythonized_result(self, how, cython_dtype, aggregate, needs_values, needs_mask, needs_ngroups, result_is_index, pre_processing, post_processing, **kwargs)
   2289                 func = partial(func, ngroups)
   2290 
-> 2291             func(**kwargs)  # Call func to modify indexer values in place
   2292 
   2293             if result_is_index:

pandas/_libs/groupby.pyx in pandas._libs.groupby.__pyx_fused_cpdef()

TypeError: No matching signature found

cc @ghuname xref #33071

@simonjayhawkins simonjayhawkins added Bug Groupby NA - MaskedArrays Related to pd.NA and nullable extension arrays labels Mar 30, 2020
@simonjayhawkins simonjayhawkins added this to the 1.1 milestone Apr 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Groupby NA - MaskedArrays Related to pd.NA and nullable extension arrays
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants