Skip to content

Commit 4779c36

Browse files
committed
TST: SparseArray.tolist()
1 parent 83c1f2b commit 4779c36

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pandas/tests/sparse/test_array.py

+6
Original file line numberDiff line numberDiff line change
@@ -928,3 +928,9 @@ def test_ufunc_args(self):
928928
sparse = SparseArray([1, -1, 0, -2], fill_value=0)
929929
result = SparseArray([2, 0, 1, -1], fill_value=1)
930930
tm.assert_sp_array_equal(np.add(sparse, 1), result)
931+
932+
def test_tolist(self):
933+
sparse = SparseArray([1, np.nan, 2, np.nan, -2])
934+
assert isinstance(sparse.tolist(), list)
935+
tm.assert_numpy_array_equal(np.array(sparse.tolist()),
936+
np.array([1, np.nan, 2, np.nan, -2]))

0 commit comments

Comments
 (0)