Skip to content

Commit

Permalink
TST: Add test of the make_spase mask generation
Browse files Browse the repository at this point in the history
  • Loading branch information
Licht-T committed Sep 18, 2017
1 parent 7804303 commit 501ba6f
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 @@ -61,6 +61,12 @@ def test_constructor_object_dtype(self):
assert arr.dtype == np.object
assert arr.fill_value == 'A'

data = [False, 0, 100.0, 0.0]
arr = SparseArray(data, dtype=np.object, fill_value=False)
assert arr.dtype == np.object
assert arr.fill_value is False
assert (arr == np.array(data, dtype=np.object)).to_dense().all()

def test_constructor_spindex_dtype(self):
arr = SparseArray(data=[1, 2], sparse_index=IntIndex(4, [1, 2]))
tm.assert_sp_array_equal(arr, SparseArray([np.nan, 1, 2, np.nan]))
Expand Down

0 comments on commit 501ba6f

Please sign in to comment.