access.fca.weighted_catchment¶
- access.fca.weighted_catchment(loc_df, cost_df, max_cost=None, cost_source='origin', cost_dest='dest', cost_cost='cost', loc_index='geoid', loc_value=None, weight_fn=None, three_stage_weight=None)[source]¶
Calculation of the floating catchment (buffered) accessibility sum, from DataFrames with computed distances. This catchment may be either a simple buffer – with cost below a single threshold – or an additional weight may be applied as a function of the access cost.
- Parameters:
- loc_dfpandas.DataFrame
should contain at _least_ a list of the locations (df_dest) at which facilities are located.
- loc_index{bool, str}
is the the name of the df column that holds the facility locations. If it is a bool, then the it the location is already on the index.
- loc_valuestr
If this value is None, a count will be used in place of a weight. Use this, for instance, to count restaurants, instead of total doctors in a practice.
- cost_dfpandas.DataFrame
This dataframe contains the precomputed costs from an origin/index location to destinations.
- cost_sourcestr
The name of the column name of the index locations – this is what will be grouped.
- cost_deststr
The name of the column name of the destination locations. This is what will be _in_ each group.
- cost_coststr
This is is the name of the cost column.
- weight_fnfunction
This function will weight the value of resources/facilities, as a function of the raw cost.
- max_costfloat
This is the maximum cost to consider in the weighted sum; note that it applies _along with_ the weight function.
- Returns:
- resourcespandas.Series
A – potentially weighted – sum of resources, facilities, or consumers.