Skip to content

Commit 0e754aa

Browse files
committed
Fixed issue with reconstructing grouped Series
1 parent bd7471c commit 0e754aa

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pandas/core/groupby.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1465,8 +1465,9 @@ def _fill(self, how, limit=None):
14651465
limit = -1
14661466
output = {}
14671467
if type(self) is DataFrameGroupBy:
1468-
for nm in self.grouper.names:
1469-
output[nm] = self.obj[nm].values
1468+
for grp in self.grouper.groupings:
1469+
ser = grp.group_index.take(grp.labels)
1470+
output[ser.name] = ser.values
14701471
for name, obj in self._iterate_slices():
14711472
indexer = np.zeros_like(labels)
14721473
mask = isnull(obj.values).view(np.uint8)

0 commit comments

Comments
 (0)