Skip to content

Commit 2d4cf40

Browse files
committed
Fixed regression against groupby apply
1 parent 88fbd09 commit 2d4cf40

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

pandas/core/base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ def _aggregate_multiple_funcs(self, arg, _level, _axis):
593593
for index, col in enumerate(obj):
594594
try:
595595
colg = self._gotitem(col, ndim=1,
596-
subset=obj.iloc[:, [index]])
596+
subset=obj.iloc[:, index])
597597
results.append(colg.aggregate(arg))
598598
keys.append(col)
599599
except (TypeError, DataError):

pandas/core/frame.py

+2
Original file line numberDiff line numberDiff line change
@@ -5746,6 +5746,8 @@ def _gotitem(self, key, ndim, subset=None):
57465746
"""
57475747
if subset is None:
57485748
subset = self
5749+
elif subset.ndim == 1:
5750+
subset = self._constructor(subset)
57495751

57505752
# TODO: _shallow_copy(subset)?
57515753
return subset[key]

0 commit comments

Comments
 (0)