tracts.population.collect_pop#

collect_pop(flatdat)#

Organizes a list of tracts into a dictionary keyed on ancestry labels.

Parameters:

flatdat (list[Tract]) – A list of tracts, where each tract has a “label” attribute corresponding to its ancestry label.

Returns:

A dictionary where the keys are ancestry labels and the values are lists of tracts with that ancestry label.

Return type:

dict[str, list[Tract]]