Skip to content

BUG: Fix sparse doctests for SciPy 1.14.0 #59094

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions pandas/core/arrays/sparse/accessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ def from_coo(cls, A, dense_index: bool = False) -> Series:
... ([3.0, 1.0, 2.0], ([1, 0, 0], [0, 2, 3])), shape=(3, 4)
... )
>>> A
<3x4 sparse matrix of type '<class 'numpy.float64'>'
with 3 stored elements in COOrdinate format>
<COOrdinate sparse matrix of dtype 'float64'
with 3 stored elements and shape (3, 4)>

>>> A.todense()
matrix([[0., 0., 1., 2.],
Expand Down Expand Up @@ -186,8 +186,8 @@ def to_coo(
... row_levels=["A", "B"], column_levels=["C", "D"], sort_labels=True
... )
>>> A
<3x4 sparse matrix of type '<class 'numpy.float64'>'
with 3 stored elements in COOrdinate format>
<COOrdinate sparse matrix of dtype 'float64'
with 3 stored elements and shape (3, 4)>
>>> A.todense()
matrix([[0., 0., 1., 3.],
[3., 0., 0., 0.],
Expand Down Expand Up @@ -380,8 +380,8 @@ def to_coo(self) -> spmatrix:
--------
>>> df = pd.DataFrame({"A": pd.arrays.SparseArray([0, 1, 0, 1])})
>>> df.sparse.to_coo()
<4x1 sparse matrix of type '<class 'numpy.int64'>'
with 2 stored elements in COOrdinate format>
<COOrdinate sparse matrix of dtype 'int64'
with 2 stored elements and shape (4, 1)>
"""
import_optional_dependency("scipy")
from scipy.sparse import coo_matrix
Expand Down
Loading