def group_by_with_aggregation(
    df,
    by,
    agg_column_names,
    aggregators = ('mean', 'std')
):
  """Group by with aggregation.

  Args:
    df: Dataframe to perform group by on.
    by: Which column to group by.
    agg_column_names: Which columns to aggregate over. Have to be columns
      containing numeric values.
    aggregators: Which aggregation functions to apply.

  Returns:
    Multi-level dataframe where each row corresponds to a group and contains
    aggregated values for specified agg_column_names and aggregators.

  """
  agg_dict = {}
  for col in agg_column_names:
    agg_dict[col] = aggregators

  return df.groupby(by, as_index=False).agg(agg_dict)