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 b449e87 commit e4d23c0
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 e4d23c0

Please sign in to comment.