get_age_by_brackets#

get_age_by_brackets(age_brackets)[source]#

Create a dictionary mapping age to the age bracket it falls in.

Parameters:

age_brackets (dict) – A dictionary mapping age bracket keys to age bracket range.

Returns:

A dictionary of age bracket by age.

Example

age_brackets = sp.get_census_age_brackets(sp.datadir,state_location='Washington',country_location='usa')
age_by_brackets = sp.get_age_by_brackets(age_brackets)