Skip to content

Commit

Permalink
TST: SparseArray.tolist()
Browse files Browse the repository at this point in the history
  • Loading branch information
kernc committed Aug 14, 2018
1 parent 83c1f2b commit 4779c36
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pandas/tests/sparse/test_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -928,3 +928,9 @@ def test_ufunc_args(self):
sparse = SparseArray([1, -1, 0, -2], fill_value=0)
result = SparseArray([2, 0, 1, -1], fill_value=1)
tm.assert_sp_array_equal(np.add(sparse, 1), result)

def test_tolist(self):
sparse = SparseArray([1, np.nan, 2, np.nan, -2])
assert isinstance(sparse.tolist(), list)
tm.assert_numpy_array_equal(np.array(sparse.tolist()),
np.array([1, np.nan, 2, np.nan, -2]))

0 comments on commit 4779c36

Please sign in to comment.