code: def _aggregate(df, by):
      
      by = [by] if isstr(by) else by
      cols = [c for c in list(df.columns) if c not in ['value'] + by]
      return df.groupby(cols).sum()['value']
docs: Aggregate `df` by specified column(s), return indexed `pd.Series`