Skip to content

Commit a67c3cd

Browse files
committed
Merge pull request #6147 from bburan-galenea/bburan/groupby-series-unique
ENH: Add unique and nunique to GroupBy whitelist
2 parents 1ed5c3e + 93dd1c3 commit a67c3cd

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-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'])

pandas/tests/test_groupby.py

+1
Original file line numberDiff line numberDiff line change
@@ -3335,6 +3335,7 @@ def test_groupby_whitelist(self):
33353335
'corr', 'cov',
33363336
'value_counts',
33373337
'diff',
3338+
'unique', 'nunique',
33383339
])
33393340

33403341
for obj, whitelist in zip((df, s),

0 commit comments

Comments
 (0)