Skip to content

Commit 5f53494

Browse files
committed
BUG: Fix wrong SparseBlock initialization in quantile method
1 parent 767217a commit 5f53494

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pandas/core/internals.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1581,6 +1581,10 @@ def _nanpercentile(values, q, axis, **kw):
15811581
result = self._try_coerce_result(result)
15821582
if is_scalar(result):
15831583
return ax, self.make_block_scalar(result)
1584+
1585+
if isinstance(self, SparseBlock):
1586+
result = SparseArray(result.flatten())
1587+
15841588
return ax, make_block(result,
15851589
placement=np.arange(len(result)),
15861590
ndim=ndim)

0 commit comments

Comments
 (0)