Skip to content

Commit b64c123

Browse files
committed
TST: Add test of the make_sparse mask generation
1 parent 7804303 commit b64c123

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
@@ -61,6 +61,12 @@ def test_constructor_object_dtype(self):
6161
assert arr.dtype == np.object
6262
assert arr.fill_value == 'A'
6363

64+
data = [False, 0, 100.0, 0.0]
65+
arr = SparseArray(data, dtype=np.object, fill_value=False)
66+
assert arr.dtype == np.object
67+
assert arr.fill_value is False
68+
assert (arr == np.array(data, dtype=np.object)).to_dense().all()
69+
6470
def test_constructor_spindex_dtype(self):
6571
arr = SparseArray(data=[1, 2], sparse_index=IntIndex(4, [1, 2]))
6672
tm.assert_sp_array_equal(arr, SparseArray([np.nan, 1, 2, np.nan]))

0 commit comments

Comments
 (0)