def _group_by_size_histogram_data(dataframe, group_by_key):
  """Returns a histogram of the number of elements per group.

    If you group by sequence_name, the dictionary you get returned is:
      key: number of predictions a sequence has
      value: number of sequences with `key` many predictions.

  Args:
    dataframe: pandas DataFrame that has column group_by_key.
    group_by_key: string. The column to group dataframe by.

  Returns:
    dict from int to int.
  """
  return dataframe.groupby(group_by_key).size().to_frame('size').groupby(
      'size').size().to_dict()