You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The unique and nunique attributes are very useful in conjunction with series groupby operations. I used these extensively in previous versions of Pandas whenever I needed to get a list of unique values for each subgroup (or the number of unique values). This can be used, for example, to count the number of subjects in each treatment group (or get a list of the subject IDs for reporting):
This is super-useful for generating summary statistics (e.g. N's) and debugging (e.g. tracking down which subjects are in which groups. In previous versions of Pandas, we could simply do:
Series.unique and Series.nunique are useful methods for querying the
unique elements (or number of unique elements) in each group when used
in conjunction with DataFrame.GroupBy. This commit addresses
pandas-dev#6146.
Series.unique and Series.nunique are useful methods for querying the
unique elements (or number of unique elements) in each group when used
in conjunction with DataFrame.GroupBy. This commit addresses
pandas-dev#6146.
jreback
pushed a commit
to jreback/pandas
that referenced
this issue
Feb 4, 2014
The
unique
andnunique
attributes are very useful in conjunction with series groupby operations. I used these extensively in previous versions of Pandas whenever I needed to get a list of unique values for each subgroup (or the number of unique values). This can be used, for example, to count the number of subjects in each treatment group (or get a list of the subject IDs for reporting):We'd get the following output:
This is super-useful for generating summary statistics (e.g. N's) and debugging (e.g. tracking down which subjects are in which groups. In previous versions of Pandas, we could simply do:
It would be nice to continue this. Is there a reason why
nunique
andunique
can't be added to the whitelist?The text was updated successfully, but these errors were encountered: