From 64bbab2f106160a29dbafef2eeeacb8eae8a5092 Mon Sep 17 00:00:00 2001 From: kcazzatoCMAP Date: Thu, 21 May 2026 12:01:54 -0500 Subject: [PATCH 1/2] update wfh columns change logic to read in the first three columns only of that file; so regardless of how many columns the input file has, it will just grab the first 3 it needs --- Database/trip_generation/trip_generation_model.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Database/trip_generation/trip_generation_model.py b/Database/trip_generation/trip_generation_model.py index 9bda35c..6a2426a 100644 --- a/Database/trip_generation/trip_generation_model.py +++ b/Database/trip_generation/trip_generation_model.py @@ -303,12 +303,10 @@ def fixed_width(outfile, df): sz.drop(szDrop, axis=1, inplace=True) # Load household work from home flag file -wfhCols = ['serial_number','wfh_flag','number_WFH_workers','tc14_not_working'] -wfhDrop = ['number_WFH_workers','tc14_not_working'] -wfh = pd.read_csv(wfhFile, names=wfhCols, engine=pdEngine) +wfhCols = ['serial_number','wfh_flag','number_WFH_workers'] +wfh = pd.read_csv(wfhFile, names=wfhCols, engine=pdEngine, usecols=[0, 1, 2]) wfh['household_record'] = wfh.index + 1 wfh['wfh_flag'] = wfh['wfh_flag'].clip(upper=1) -wfh.drop(wfhDrop, axis=1, inplace=True) # Load household vehicle type category file hhvtype = pd.read_csv(hhvtypeFile, dtype='Int64', engine=pdEngine) From 50a4338ee8d59731e0b78c64082c01f0d4f57670 Mon Sep 17 00:00:00 2001 From: kcazzatoCMAP Date: Thu, 21 May 2026 12:04:57 -0500 Subject: [PATCH 2/2] update only 2 columns The script only actually needs the first two columns so I made that update --- Database/trip_generation/trip_generation_model.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Database/trip_generation/trip_generation_model.py b/Database/trip_generation/trip_generation_model.py index 6a2426a..ce9a4da 100644 --- a/Database/trip_generation/trip_generation_model.py +++ b/Database/trip_generation/trip_generation_model.py @@ -303,8 +303,8 @@ def fixed_width(outfile, df): sz.drop(szDrop, axis=1, inplace=True) # Load household work from home flag file -wfhCols = ['serial_number','wfh_flag','number_WFH_workers'] -wfh = pd.read_csv(wfhFile, names=wfhCols, engine=pdEngine, usecols=[0, 1, 2]) +wfhCols = ['serial_number','wfh_flag'] +wfh = pd.read_csv(wfhFile, names=wfhCols, engine=pdEngine, usecols=[0, 1]) wfh['household_record'] = wfh.index + 1 wfh['wfh_flag'] = wfh['wfh_flag'].clip(upper=1)