transitlos.equity¶
Pure population-weighted equity statistics over a combined access/population table.
No I/O, no dependency on any other transitlos module or the sibling
packages -- only numpy/pandas. Takes whatever
transitlos.population.cross_with_population (or any DataFrame with the
same two columns) produces.
equity_statistics(combined_gdf, score_col='level_of_service', population_col='population', groups=None, thresholds=(0.25, 0.5, 0.75))
¶
Compute population-weighted access-equity statistics.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
combined_gdf
|
DataFrame
|
DataFrame/GeoDataFrame with |
required |
score_col
|
str
|
Column holding the per-row level of service. |
'level_of_service'
|
population_col
|
str
|
Column holding the per-row population count, used as weights throughout. |
'population'
|
groups
|
Optional[Union[str, Sequence[str]]]
|
Optional column name (or list of column names) to also break statistics down by, in addition to the overall figures. |
None
|
thresholds
|
Sequence[float]
|
Score thresholds used to report the population share above/below each one. |
(0.25, 0.5, 0.75)
|
Returns:
| Type | Description |
|---|---|
dict
|
A dict with keys |
dict
|
|
dict
|
|
dict
|
if |
dict
|
the group column(s) with the same statistics per group. |