From a397da111002d460b9f4345bb98899769ce524a8 Mon Sep 17 00:00:00 2001 From: Richard Shadrach Date: Tue, 24 Nov 2020 12:52:22 -0500 Subject: [PATCH] CLN: Remove .values from groupby.sem --- pandas/core/groupby/groupby.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pandas/core/groupby/groupby.py b/pandas/core/groupby/groupby.py index 6e26e9a43bb2a..ae3612c99d5cd 100644 --- a/pandas/core/groupby/groupby.py +++ b/pandas/core/groupby/groupby.py @@ -1600,10 +1600,8 @@ def sem(self, ddof: int = 1): cols = result.columns.get_indexer_for( result.columns.difference(self.exclusions).unique() ) - # TODO(GH-22046) - setting with iloc broken if labels are not unique - # .values to remove labels - result.iloc[:, cols] = ( - result.iloc[:, cols].values / np.sqrt(self.count().iloc[:, cols]).values + result.iloc[:, cols] = result.iloc[:, cols] / np.sqrt( + self.count().iloc[:, cols] ) return result