Skip to content

Commit aa7c075

Browse files
committed
cicd pipeline
1 parent 8bdde85 commit aa7c075

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

pandas/core/groupby/groupby.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -447,17 +447,27 @@ def __call__(self, *args, **kwargs):
447447
kwargs = dict(kwargs)
448448
kwargs.pop("colormap", None)
449449

450-
def f(group, color, label):
451-
return group.plot(*args, color=color, label=label, **kwargs)
450+
def f(obj, color=None, label=None):
451+
plot_kwargs = dict(kwargs)
452+
if color is not None:
453+
plot_kwargs["color"] = color
454+
if label is not None:
455+
plot_kwargs["label"] = label
456+
return obj.plot(*args, **plot_kwargs)
452457

453458
results = []
454459
for i, (name, group) in enumerate(self._groupby):
455460
results.append(f(group, colors[i], name))
456461
return results
457462
else:
458463

459-
def f(self):
460-
return self.plot(*args, **kwargs)
464+
def f(obj, color=None, label=None):
465+
plot_kwargs = dict(kwargs)
466+
if color is not None:
467+
plot_kwargs["color"] = color
468+
if label is not None:
469+
plot_kwargs["label"] = label
470+
return obj.plot(*args, **plot_kwargs)
461471

462472
f.__name__ = "plot"
463473
return self._groupby._python_apply_general(f, self._groupby._selected_obj)

0 commit comments

Comments
 (0)