From 943cf9d05e48a471a6273d8279b83cdc2e866fd9 Mon Sep 17 00:00:00 2001 From: Richard Shadrach Date: Wed, 24 Feb 2021 10:44:43 -0500 Subject: [PATCH 1/3] CI/TST: Supply dtype to coo_matrix until scipy is fixed --- pandas/tests/arrays/sparse/test_array.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pandas/tests/arrays/sparse/test_array.py b/pandas/tests/arrays/sparse/test_array.py index 31522f24fc7a2..8a8cd213e02e1 100644 --- a/pandas/tests/arrays/sparse/test_array.py +++ b/pandas/tests/arrays/sparse/test_array.py @@ -1185,7 +1185,9 @@ def test_from_coo(self): row = [0, 3, 1, 0] col = [0, 3, 1, 2] data = [4, 5, 7, 9] - sp_array = scipy.sparse.coo_matrix((data, (row, col))) + # TODO: Remove dtype when scipy is fixed + # https://github.com/scipy/scipy/issues/13585 + sp_array = scipy.sparse.coo_matrix((data, (row, col)), dtype="int64") result = pd.Series.sparse.from_coo(sp_array) index = pd.MultiIndex.from_arrays([[0, 0, 1, 3], [0, 2, 1, 3]]) From 9eae341b3798af154b5caea2e0d6399a2d122009 Mon Sep 17 00:00:00 2001 From: Richard Shadrach Date: Wed, 24 Feb 2021 12:21:48 -0500 Subject: [PATCH 2/3] intp --- pandas/tests/arrays/sparse/test_array.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/tests/arrays/sparse/test_array.py b/pandas/tests/arrays/sparse/test_array.py index 8a8cd213e02e1..4f4805fd230e3 100644 --- a/pandas/tests/arrays/sparse/test_array.py +++ b/pandas/tests/arrays/sparse/test_array.py @@ -1187,7 +1187,7 @@ def test_from_coo(self): data = [4, 5, 7, 9] # TODO: Remove dtype when scipy is fixed # https://github.com/scipy/scipy/issues/13585 - sp_array = scipy.sparse.coo_matrix((data, (row, col)), dtype="int64") + sp_array = scipy.sparse.coo_matrix((data, (row, col)), dtype="intp") result = pd.Series.sparse.from_coo(sp_array) index = pd.MultiIndex.from_arrays([[0, 0, 1, 3], [0, 2, 1, 3]]) From 897f49c2277b8f402a2333ee197dd705ebac8602 Mon Sep 17 00:00:00 2001 From: Richard Shadrach Date: Wed, 24 Feb 2021 14:18:45 -0500 Subject: [PATCH 3/3] int --- pandas/tests/arrays/sparse/test_array.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/tests/arrays/sparse/test_array.py b/pandas/tests/arrays/sparse/test_array.py index 4f4805fd230e3..da7719e42a205 100644 --- a/pandas/tests/arrays/sparse/test_array.py +++ b/pandas/tests/arrays/sparse/test_array.py @@ -1187,7 +1187,7 @@ def test_from_coo(self): data = [4, 5, 7, 9] # TODO: Remove dtype when scipy is fixed # https://github.com/scipy/scipy/issues/13585 - sp_array = scipy.sparse.coo_matrix((data, (row, col)), dtype="intp") + sp_array = scipy.sparse.coo_matrix((data, (row, col)), dtype="int") result = pd.Series.sparse.from_coo(sp_array) index = pd.MultiIndex.from_arrays([[0, 0, 1, 3], [0, 2, 1, 3]])