Skip to content
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

API: Harmonize dtype for index levels for Series.sparse.from_coo #50926

Merged
merged 2 commits into from Jan 23, 2023

Conversation

topper-123
Copy link
Contributor

Currently the levels of the index the sparse series has different dtype (int32 or int64), depending on if the dense_index is true or False. This PR makes the dtype to be always int32, the same as the row/col attributes of the scipy coo_matrix.

See also discussion here: #49560 (comment).

@topper-123
Copy link
Contributor Author

The failure looks unrelated.

@mroeschke mroeschke added the Sparse Sparse Data Type label Jan 23, 2023
@mroeschke mroeschke added this to the 2.0 milestone Jan 23, 2023
Copy link
Member

@mroeschke mroeschke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes sense to maintain the same numpy dtype from scipy.sparse

@mroeschke mroeschke merged commit 1128f5e into pandas-dev:main Jan 23, 2023
@mroeschke
Copy link
Member

Thanks @topper-123

@topper-123 topper-123 deleted the Series.sparse.from_coo branch January 23, 2023 18:53
pooja-subramaniam pushed a commit to pooja-subramaniam/pandas that referenced this pull request Jan 25, 2023
…das-dev#50926)

* API: Harmonize dtype for index levels for Series.sparse.from_coo

* add gh number
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Sparse Sparse Data Type
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants