Skip to content

Commit 437f27f

Browse files
committed
BUG: Add is_sparse check in 1D check statement
1 parent a3a176e commit 437f27f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pandas/core/internals.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1442,7 +1442,8 @@ def func(cond, values, other):
14421442
transpose=transpose)
14431443
return self._maybe_downcast(blocks, 'infer')
14441444

1445-
if self._can_hold_element(fill_value) or self.ndim == 1:
1445+
if self._can_hold_element(fill_value) or \
1446+
self.is_sparse or self.ndim == 1:
14461447

14471448
if transpose:
14481449
result = result.T

0 commit comments

Comments
 (0)