diff --git a/larray/core/array.py b/larray/core/array.py index b74210288..6342d3223 100644 --- a/larray/core/array.py +++ b/larray/core/array.py @@ -2942,12 +2942,15 @@ def with_total(self, *args, **kwargs): Parameters ---------- - args - kwargs - op : aggregate function - Defaults to `sum()`. - label : scalar value - label to use for the total. Defaults to "total". + \*args : int or str or Axis or Group or any combination of those, optional + Axes or groups along which to compute the aggregates. Defaults to aggregate over the whole array. + \**kwargs + * op : aggregate function + + Defaults to `sum()`. + * label : scalar value + + label to use for the total. Defaults to "total". Returns ------- @@ -2967,6 +2970,12 @@ def with_total(self, *args, **kwargs): a1 3 4 5 12 a2 6 7 8 21 total 9 12 15 36 + >>> arr.with_total('a') + a\\b b0 b1 b2 + a0 0 1 2 + a1 3 4 5 + a2 6 7 8 + total 9 12 15 >>> arr.with_total(op=prod, label='product') a\\b b0 b1 b2 product a0 0 1 2 0