Skip to content

Column.unique #135

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

Closed
MarcoGorelli opened this issue Apr 12, 2023 · 3 comments · Fixed by #151
Closed

Column.unique #135

MarcoGorelli opened this issue Apr 12, 2023 · 3 comments · Fixed by #151

Comments

@MarcoGorelli
Copy link
Contributor

Any objections to adding Column.unique to get the unique values in a Column?
It could return another Column with just the unique values.

Why do we need this? From #131 (comment), if we're disallowing iterating over groups, then the workaround is to find the unique values, filter by them, and apply the user-defined function each time

@rgommers
Copy link
Member

adding a unique method to columns seems perfectly reasonable to me. I'm not even sure it needs that detailed a rationale - unique is a pretty fundamental operation for dataframe libraries I'd think, and hence having that as a method on both dataframes and columns seems expected.

@kkraus14
Copy link
Collaborator

+1 on the function

We may want to document any ordering guarantees or lack thereof as well.

@jorisvandenbossche
Copy link
Member

We may want to document any ordering guarantees or lack thereof as well.

Probably the lack of any ordering guarantee? So neither sorted (what numpy does) or order of appearance (what pandas does)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants