Skip to content

Commit b76e5eb

Browse files
committed
BUG: Add SparseArray.all method
1 parent 82e8484 commit b76e5eb

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pandas/core/sparse/array.py

+9
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,15 @@ def fillna(self, value, downcast=None):
605605
return self._simple_new(new_values, self.sp_index,
606606
fill_value=fill_value)
607607

608+
def all(self, axis=0, *args, **kwargs):
609+
values = self.sp_values
610+
611+
if len(values) != len(self):
612+
values = values.tolist()
613+
values.append(self.fill_value)
614+
615+
return np.all(values, axis, *args, **kwargs)
616+
608617
def sum(self, axis=0, *args, **kwargs):
609618
"""
610619
Sum of non-NA/null values

0 commit comments

Comments
 (0)