Skip to content

Commit

Permalink
fixing issue 34 by @alexandermichels, slightly differently and in 3SF…
Browse files Browse the repository at this point in the history
…CA also (#36)
  • Loading branch information
JamesSaxon authored Jun 4, 2022
1 parent b3f88da commit 445c7ed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion access/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "1.1.7"
__version__ = "1.1.8"
"""
:mod:`access` --- Accessibility Metrics
=================================================
Expand Down
6 changes: 4 additions & 2 deletions access/fca.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ def two_stage_fca(demand_df, supply_df, cost_df, max_cost = None,
weight_fn = weight_fn)

#create a temporary dataframe, temp, that holds the supply and aggregate demand at each location
temp = supply_df.join(total_demand_series, how = 'right', rsuffix='_W')
total_demand_series.name += "_W"
temp = supply_df.join(total_demand_series, how = 'right')

#there may be NA values due to a shorter supply dataframe than the demand dataframe.
#in this case, replace any potential NA values(which correspond to supply locations with no supply) with 0.
Expand Down Expand Up @@ -303,7 +304,8 @@ def three_stage_fca(demand_df, supply_df, cost_df, max_cost,
weight_fn = weight_fn, three_stage_weight = True)

#create a temporary dataframe, temp, that holds the supply and aggregate demand at each location
temp = supply_df.join(total_demand_series, how = 'right', rsuffix = '_W')
total_demand_series.name += "_W"
temp = supply_df.join(total_demand_series, how = 'right')

#there may be NA values due to a shorter supply dataframe than the demand dataframe.
#in this case, replace any potential NA values(which correspond to supply locations with no supply) with 0.
Expand Down

0 comments on commit 445c7ed

Please sign in to comment.