Skip to content

Commit 0546720

Browse files
bburan-galeneajreback
authored andcommitted
ENH: Add unique and nunique to GroupBy whitelist
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.
1 parent f444b91 commit 0546720

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/core/groupby.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575

7676
_series_apply_whitelist = \
7777
(_common_apply_whitelist - set(['boxplot'])) | \
78-
frozenset(['dtype', 'value_counts'])
78+
frozenset(['dtype', 'value_counts', 'unique', 'nunique'])
7979

8080
_dataframe_apply_whitelist = \
8181
_common_apply_whitelist | frozenset(['dtypes', 'corrwith'])

0 commit comments

Comments
 (0)