diff --git a/pandas/core/groupby.py b/pandas/core/groupby.py index 46711e4917e4c..e8a9d6e49a066 100644 --- a/pandas/core/groupby.py +++ b/pandas/core/groupby.py @@ -68,7 +68,7 @@ 'shift', 'tshift', 'ffill', 'bfill', 'pct_change', 'skew', - 'corr', 'cov', + 'corr', 'cov', 'diff', ]) | _plotting_methods _series_apply_whitelist = \ diff --git a/pandas/tests/test_groupby.py b/pandas/tests/test_groupby.py index fef6a18acd7ff..942efdfc23740 100644 --- a/pandas/tests/test_groupby.py +++ b/pandas/tests/test_groupby.py @@ -3270,6 +3270,7 @@ def test_groupby_whitelist(self): 'plot', 'boxplot', 'hist', 'median', 'dtypes', 'corrwith', 'corr', 'cov', + 'diff', ]) s_whitelist = frozenset([ 'last', 'first', @@ -3290,6 +3291,7 @@ def test_groupby_whitelist(self): 'median', 'dtype', 'corr', 'cov', 'value_counts', + 'diff', ]) for obj, whitelist in zip((df, s), @@ -3411,7 +3413,7 @@ def test_tab_completion(self): 'resample', 'cummin', 'fillna', 'cumsum', 'cumcount', 'all', 'shift', 'skew', 'bfill', 'irow', 'ffill', 'take', 'tshift', 'pct_change', 'any', 'mad', 'corr', 'corrwith', - 'cov', 'dtypes', + 'cov', 'dtypes', 'diff', ]) self.assertEqual(results, expected)