Skip to content

Commit

Permalink
Updated the way FAF code was assigned for newly created firms when sc…
Browse files Browse the repository at this point in the history
…aling employment
  • Loading branch information
goreaditya committed Mar 18, 2021
1 parent fcb1793 commit 6dae6c1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions rFirm/steps/firm_synthesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ def est_sim_scale_employees(
# - Update the County and State FIPS and FAF zones
new_est.state_FIPS = reindex(taz_fips.state_FIPS, new_est.TAZ)
new_est.county_FIPS = reindex(taz_fips.county_FIPS, new_est.TAZ)
new_est.FAF4 = reindex(taz_faf.FAF, new_est.TAZ)
new_est.FAF4 = reindex(taz_faf.set_index('TAZ').FAF, new_est.TAZ)

# - Give the new est new, unique business IDs
new_est.reset_index(drop=True, inplace=True)
Expand Down Expand Up @@ -1023,7 +1023,7 @@ def est_sim_producers(est, io_values, unitcost):
MAX_BUS_ID = producers.seller_id.max()

# FIXME convert producers to dictionary of data-frame for ease of storage
producers = dict(tuple(producers.groupby(['NAICS', 'SCTG'])))
producers = dict(producers.groupby(['NAICS', 'SCTG']).__iter__())

return producers, MAX_BUS_ID

Expand Down Expand Up @@ -1330,8 +1330,8 @@ def est_sim_consumers(est, io_values, NAICS2007io_to_SCTG, unitcost, est_pref_we
# consumers['input_commodity'] = consumers['NAICS']

# FIXME store consumers as a dictionary of data-frame for ease of storage
consumers = dict(tuple(consumers.groupby(['input_commodity', 'SCTG'])))
consumers_foreign = dict(tuple(consumers_foreign.groupby(['input_commodity', 'SCTG'])))
consumers = dict(consumers.groupby(['input_commodity', 'SCTG']).__iter__())
consumers_foreign = dict(consumers_foreign.groupby(['input_commodity', 'SCTG']).__iter__())
consumers = {naics_sctg: df.append(consumers_foreign.get(naics_sctg), ignore_index=True) for
naics_sctg, df in consumers.iteritems()}

Expand Down

0 comments on commit 6dae6c1

Please sign in to comment.