Skip to content

BUG: fix quantile for nullable integer/float #39771

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
jorisvandenbossche opened this issue Feb 12, 2021 · 0 comments · Fixed by #41428
Closed

BUG: fix quantile for nullable integer/float #39771

jorisvandenbossche opened this issue Feb 12, 2021 · 0 comments · Fixed by #41428
Labels
Blocker Blocking issue or pull request for an upcoming release NA - MaskedArrays Related to pd.NA and nullable extension arrays Regression Functionality that used to work in a prior pandas version
Milestone

Comments

@jorisvandenbossche
Copy link
Member

This is a regression in master due to #39606, so we should fix it before 1.3.

In [1]: pd.Series([1, 2, 3], dtype="Int64").quantile(0.75)
..
~/scipy/pandas/pandas/core/internals/blocks.py in quantile(self, qs, interpolation, axis)
   1858             # shape[0] should be 1 as long as EAs are 1D
   1859             assert result.shape == (1, len(qs)), result.shape
-> 1860             result = type(self.values)._from_factorized(result[0], self.values)
   1861 
   1862         return make_block(result, placement=self.mgr_locs, ndim=2)

~/scipy/pandas/pandas/core/arrays/base.py in _from_factorized(cls, values, original)
    255         ExtensionArray.factorize : Encode the extension array as an enumerated type.
    256         """
--> 257         raise AbstractMethodError(cls)
    258 
    259     # ------------------------------------------------------------------------

AbstractMethodError: This method must be defined in the concrete class type
@jorisvandenbossche jorisvandenbossche added Regression Functionality that used to work in a prior pandas version NA - MaskedArrays Related to pd.NA and nullable extension arrays labels Feb 12, 2021
@jorisvandenbossche jorisvandenbossche added this to the 1.3 milestone Feb 12, 2021
@jorisvandenbossche jorisvandenbossche added the Blocker Blocking issue or pull request for an upcoming release label Mar 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blocker Blocking issue or pull request for an upcoming release NA - MaskedArrays Related to pd.NA and nullable extension arrays Regression Functionality that used to work in a prior pandas version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant