Skip to content

Commit cc81940

Browse files
committed
BUG: Simplify fill_value check in SparseArray.all
1 parent 6079863 commit cc81940

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pandas/core/sparse/array.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -626,9 +626,8 @@ def all(self, axis=0, *args, **kwargs):
626626

627627
values = self.sp_values
628628

629-
if len(values) != len(self):
630-
values = values.tolist()
631-
values.append(self.fill_value)
629+
if len(values) != len(self) and not np.all(self.fill_value):
630+
return False
632631

633632
return np.all(values, axis, *args, **kwargs)
634633

0 commit comments

Comments
 (0)