Skip to content

Commit a1f5c2a

Browse files
committed
Override SparseArray.tolist() to return *dense* list
1 parent 0aba225 commit a1f5c2a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pandas/core/sparse/array.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,10 @@ def astype(self, dtype=None, copy=True):
592592
return self._simple_new(sp_values, self.sp_index,
593593
fill_value=fill_value)
594594

595+
def tolist(self):
596+
"""Return *dense* self as list"""
597+
return self.values.tolist()
598+
595599
def copy(self, deep=True):
596600
"""
597601
Make a copy of the SparseArray. Only the actual sparse values need to

0 commit comments

Comments
 (0)