Skip to content

Commit ea077b3

Browse files
committed
BUG: Fix SparseBlock quantile
1 parent 7928aaa commit ea077b3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pandas/core/internals.py

+4
Original file line numberDiff line numberDiff line change
@@ -1577,6 +1577,10 @@ def _nanpercentile(values, q, axis, **kw):
15771577
result = self._try_coerce_result(result)
15781578
if is_scalar(result):
15791579
return ax, self.make_block_scalar(result)
1580+
1581+
if isinstance(self, SparseBlock):
1582+
result = SparseArray(result.flatten())
1583+
15801584
return ax, make_block(result,
15811585
placement=np.arange(len(result)),
15821586
ndim=ndim)

0 commit comments

Comments
 (0)