Closed
Description
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.