Skip to content

BUG: fix quantile for nullable integer/float #39771

Closed
@jorisvandenbossche

Description

@jorisvandenbossche

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    BlockerBlocking issue or pull request for an upcoming releaseNA - MaskedArraysRelated to pd.NA and nullable extension arraysRegressionFunctionality that used to work in a prior pandas version

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions