From 2a755bbfcb5a4933b448e5e4baf09dc6d8bcd83e Mon Sep 17 00:00:00 2001 From: "martin.holmer@gmail.com" Date: Fri, 18 Oct 2024 10:29:28 -0400 Subject: [PATCH] Add ability to comment out one or more lines in a targets file --- tmd/areas/create_area_weights.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tmd/areas/create_area_weights.py b/tmd/areas/create_area_weights.py index 0fb5da03..dee74229 100644 --- a/tmd/areas/create_area_weights.py +++ b/tmd/areas/create_area_weights.py @@ -199,7 +199,8 @@ def prepared_data(area: str, vardf: pd.DataFrame): """ national_population = (vardf.s006 * vardf.XTOT).sum() numobs = len(vardf) - tdf = pd.read_csv(AREAS_FOLDER / "targets" / f"{area}_targets.csv") + targets_file = AREAS_FOLDER / "targets" / f"{area}_targets.csv" + tdf = pd.read_csv(targets_file, comment="#") tm_tuple = () ta_list = [] row_num = 1