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

Add .nunique method to DataFrame and .groupby #15794

Closed
topper-123 opened this issue Mar 23, 2017 · 3 comments
Closed

Add .nunique method to DataFrame and .groupby #15794

topper-123 opened this issue Mar 23, 2017 · 3 comments
Labels
Duplicate Report Duplicate issue or pull request Enhancement Reshaping Concat, Merge/Join, Stack/Unstack, Explode

Comments

@topper-123
Copy link
Contributor

Currently, pd.DataFrame does not have a .nunique method

DataFrames have various aggregation methods that they share with series, examples being .sum, .count etc. Likewise with DataFrame.groupby-objects.

In many cases, a .nunique would be useful as on DataFrame and DataFrame.groupby-objects, for example when you're trying to assess the diversity of data in a DataFrame.

Expected Output

When you're using DataFrame.nunique, with n columns, you should get back a series where the index values are the dataframe.columns values, and the series values are the count of unique values, for each column.

@jreback
Copy link
Contributor

jreback commented Mar 23, 2017

you mean like this? #14376

this will be in 0.20.0 (soon)

@jreback jreback closed this as completed Mar 23, 2017
@jreback
Copy link
Contributor

jreback commented Mar 23, 2017

duplicate of #14336

@jreback jreback added Duplicate Report Duplicate issue or pull request Enhancement Reshaping Concat, Merge/Join, Stack/Unstack, Explode labels Mar 23, 2017
@jreback jreback modified the milestones: 0.20.0, No action Mar 23, 2017
@topper-123
Copy link
Contributor Author

you mean like this? #14376

Yes, thanks. I only looked through open issues, should have considered closed ones since 19.2 also.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate Report Duplicate issue or pull request Enhancement Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

No branches or pull requests

2 participants