Skip to content

Commit 3dfb6d4

Browse files
TST: fix incorrect sparse test (now failing on scipy master) (#25653)
1 parent 99bffa2 commit 3dfb6d4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pandas/tests/arrays/sparse/test_array.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1091,11 +1091,11 @@ def test_from_coo(self):
10911091
row = [0, 3, 1, 0]
10921092
col = [0, 3, 1, 2]
10931093
data = [4, 5, 7, 9]
1094-
sp_array = sparse.coo_matrix(data, (row, col))
1094+
sp_array = sparse.coo_matrix((data, (row, col)))
10951095
result = pd.Series.sparse.from_coo(sp_array)
10961096

1097-
index = pd.MultiIndex.from_product([[0], [0, 1, 2, 3]])
1098-
expected = pd.Series(data, index=index, dtype='Sparse[int]')
1097+
index = pd.MultiIndex.from_arrays([[0, 0, 1, 3], [0, 2, 1, 3]])
1098+
expected = pd.Series([4, 9, 7, 5], index=index, dtype='Sparse[int]')
10991099
tm.assert_series_equal(result, expected)
11001100

11011101
def test_to_coo(self):

0 commit comments

Comments
 (0)