access.Access.fca_ratio¶
- Access.fca_ratio(name='fca', demand_cost=None, supply_cost=None, supply_values=None, max_cost=None, normalize=False, noise='quiet')[source]¶
Calculate the floating catchment area (buffer) ratio access score.
- Parameters:
- namestr
Column name for access values
- demand_coststr
Name of demand cost value column in demand_df
- supply_coststr
Name of supply cost value column in supply_df
- supply_values{str, list}
Name(s) of supply values in supply_df
- max_costfloat
Cutoff of cost values
- normalizebool
If True, return normalized access values; otherwise, return raw access values
- noisestr
Default ‘quiet’, otherwise gives messages that indicate potential issues.
- Returns:
- accesspandas Series
Accessibility score for origin locations.
Examples
Import the base Access class and Datasets.
>>> from access import Access, Datasets
Load each of the example datasets:
>>> chi_docs_dents = Datasets.load_data('chi_doc') >>> chi_population = Datasets.load_data('chi_pop') >>> chi_travel_costs = Datasets.load_data('chi_times')
>>> chi_docs_dents.head() geoid doc dentist 0 17031010100 1 1 1 17031010201 0 1 2 17031010202 4 1 3 17031010300 4 1 4 17031010400 0 2
>>> chi_population.head() geoid pop 0 17031010100 4854 1 17031010201 6450 2 17031010202 2818 3 17031010300 6236 4 17031010400 5042
>>> chi_travel_costs.head() origin dest cost 0 17093890101 17031010100 91.20 1 17093890101 17031010201 92.82 2 17093890101 17031010202 92.95 3 17093890101 17031010300 89.40 4 17093890101 17031010400 84.97
Using the example data, create an Access object.
>>> chicago_primary_care = Access(demand_df = chi_population, demand_index = "geoid", demand_value = "pop", supply_df = chi_docs_dents, supply_index = "geoid", supply_value = ["doc", "dentist"], cost_df = chi_travel_costs, cost_origin = "origin", cost_dest = "destination", cost_name = "cost", neighbor_cost_df = chi_travel_costs, neighbor_cost_origin = "origin", neighbor_cost_dest = 'dest', neighbor_cost_name = 'cost')
>>> chicago_primary_care.fca_ratio(name='fca',max_cost=30) fca_doc fca_dentist geoid 17031010100 0.001630 0.000807 17031010201 0.001524 0.000904 17031010202 0.001521 0.000908 ........... ........ ........ 17197884101 0.000437 0.000442 17197884103 0.000510 0.000498 17197980100 0.000488 0.000432