Skip to content

Commit 2a37fc0

Browse files
committed
series, frame passing
1 parent 148a19d commit 2a37fc0

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

pandas/core/generic.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -5232,7 +5232,9 @@ def finalize_name(objs):
52325232
elif method == "align_series":
52335233
assert isinstance(other, tuple)
52345234
self.allows_duplicate_labels = merge_all(other, duplicate_labels)
5235-
self.name = finalize_name(other)
5235+
if self.ndim == 1:
5236+
# apparently called with DataFrame too
5237+
self.name = other[0].name
52365238
elif method in {"groupby-aggregate", "window"}:
52375239
self.allows_duplicate_labels = other.obj.allows_duplicate_labels
52385240

pandas/core/groupby/generic.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,9 @@ def aggregate(self, func, *args, **kwargs):
274274
result = result.iloc[:, order]
275275
result.columns = columns
276276

277-
return result._convert(datetime=True).__finalize__(method="groupby-aggregate")
277+
return result._convert(datetime=True).__finalize__(
278+
self, method="groupby-aggregate"
279+
)
278280

279281
agg = aggregate
280282

0 commit comments

Comments
 (0)