Skip to content

ENH: Make explode work for sets #35637

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 10 commits into from
Sep 5, 2020
Merged

ENH: Make explode work for sets #35637

merged 10 commits into from
Sep 5, 2020

Conversation

dsaxton
Copy link
Member

@dsaxton dsaxton commented Aug 8, 2020

@dsaxton dsaxton added Enhancement Reshaping Concat, Merge/Join, Stack/Unstack, Explode labels Aug 8, 2020
@mroeschke mroeschke added this to the 1.2 milestone Aug 9, 2020
Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

impls and tests look fine, the only issue i have is one of ordering. sets are un-ordered, unlike lists and dicst so this could in theory change between runs?

@dsaxton
Copy link
Member Author

dsaxton commented Aug 13, 2020

impls and tests look fine, the only issue i have is one of ordering. sets are un-ordered, unlike lists and dicst so this could in theory change between runs?

That's true, the order of the output won't be well-defined and could change between runs

@mroeschke
Copy link
Member

Maybe for the test we just use a set with 1 element so its deterministic, and in the docs we can highlight for sets order is not guaranteed.

@dsaxton
Copy link
Member Author

dsaxton commented Aug 22, 2020

Maybe for the test we just use a set with 1 element so its deterministic, and in the docs we can highlight for sets order is not guaranteed.

Good catch on updating docs. For the tests I'm thinking we'd want multiple elements to show that it actually expands the result (I could add a singleton set case as well to show that it becomes a scalar)? To deal with non-deterministic order we can sort the output.

@jreback
Copy link
Contributor

jreback commented Sep 5, 2020

this looks fine, can you merge master and merge on green.

@dsaxton dsaxton merged commit cda2f54 into pandas-dev:master Sep 5, 2020
@dsaxton dsaxton deleted the explode-sets branch September 5, 2020 22:36
jbrockmendel pushed a commit to jbrockmendel/pandas that referenced this pull request Sep 8, 2020
kesmit13 pushed a commit to kesmit13/pandas that referenced this pull request Nov 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ENH: Make Series.explode work for sets
4 participants