Skip to content

BUG: DataFrame.sparse.from_spmatrix hard codes an invalid fill_value for certain subtypes #59064

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
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
CLN: ✏️ Fix instantiation of np.ma.array in test.
  • Loading branch information
christophertitchen committed Jun 27, 2024
commit 9eb3dac4ed9d3dcbfb8e2bd130159e095d5f9eb5
2 changes: 1 addition & 1 deletion pandas/tests/arrays/sparse/test_accessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def test_from_spmatrix(self, format, labels, dtype):
result = pd.DataFrame.sparse.from_spmatrix(sp_mat, index=labels, columns=labels)
mat = np.eye(10, dtype=dtype)
expected = pd.DataFrame(
np.ma.masked_array(mat, mask=(mat == 0)).filled(sp_dtype.fill_value),
np.ma.array(mat, mask=(mat == 0)).filled(sp_dtype.fill_value),
index=labels,
columns=labels,
).astype(sp_dtype)
Expand Down
Loading