Skip to content

BUG: fix SparseArray.unique IndexError and _first_fill_value_loc algo #47810

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 6 commits into from
Jul 22, 2022

Conversation

GYHHAHA
Copy link
Contributor

@GYHHAHA GYHHAHA commented Jul 21, 2022

Only on master, whatsnew omitted. Please review #47779 after this merged. Remind that pd.unique/SparseArray and np.unique is not the same. The former one will keep the original order (which is from pd.core.algorithms.unique) and numpy unique will sort the result. cc @mzeitlin11

Copy link
Member

@mzeitlin11 mzeitlin11 left a comment

Choose a reason for hiding this comment

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

Thanks @GYHHAHA! LGTM, can you please add a small note in the 1.5 whatsnew about this fix?

@mzeitlin11 mzeitlin11 added Bug Sparse Sparse Data Type labels Jul 21, 2022
@mzeitlin11 mzeitlin11 added this to the 1.5 milestone Jul 21, 2022
@GYHHAHA
Copy link
Contributor Author

GYHHAHA commented Jul 21, 2022

Since 1.4.3 and main behave differently, I change the issue title according to the 1.4.3 behavior since it's more closer to the users. In whatsnew, since error on main will not be visible to users, I choose to give the bug description from 1.4.3.

@mroeschke mroeschke merged commit 3d94f7a into pandas-dev:main Jul 22, 2022
@mroeschke
Copy link
Member

Thanks @GYHHAHA!

@GYHHAHA GYHHAHA deleted the patch-2 branch July 25, 2022 04:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Sparse Sparse Data Type
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: SparseArray.unique fails to keep original elements order
3 participants