get_aggregate_ages#

get_aggregate_ages(ages, age_by_brackets)[source]#

Create a dictionary of the count of ages by age brackets.

Parameters:
  • ages (dict) – A dictionary of age count by single year.

  • age_by_brackets (dict) – A dictionary mapping age to the age bracket range it falls within.

Returns:

A dictionary of aggregated age count for specified age brackets.

Example

aggregate_age_count = sp.get_aggregate_ages(age_count, age_by_brackets)
aggregate_matrix = symmetric_matrix.copy()
aggregate_matrix = sp.get_aggregate_matrix(aggregate_matrix, age_by_brackets)