-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
SparseDataFrame.to_coo does not convert the default fill value when is not 0 #24817
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
Comments
Can you shorten the example to remove the unnecessary lines? Can you show the actual output and the expected output? Finally, can you try on 0.24.0rc1? I don't recall if these were fixed or not, but sparse got an overhaul.
|
I have updated to 0.24.0rc1 and added the output of each block. The problem persists. |
I guess the right behaviour of fillna on a sparse dataframe should be |
To avoid surprises, I would raise an informative error when the fill value is not zero, pointing people towards doing changing the fill value before converting to scipy (since scipy simply does not support any other fill value). Ideally we do this before 0.25, and only for the DataFrame.sparse.to_coo version, since that is still new. |
Moving this off 1.0, but I've updated the original post with a simplified description. This should be a good first isssue. |
Hi, I want to help out with this issue. Can i take it up? This would be my first open source contribution |
take |
1 similar comment
take |
take |
take |
DataFrame.sparse.to_coo()
should raise when thefill_value
is not zero, sincescipy.sparse
only supports filling with 0.That's incorrect. It should instead raise a
ValueError
with a nice message.The text was updated successfully, but these errors were encountered: