From af2d45bcdb9eb3ffa0575a6f532263b3b0910f23 Mon Sep 17 00:00:00 2001 From: Sally Grindstaff Date: Tue, 23 Apr 2024 11:26:23 -0700 Subject: [PATCH] parse-kp: read census tract as string Read in census tract as string in order to preserve leading 0s. --- lib/seattleflu/id3c/cli/command/clinical.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/seattleflu/id3c/cli/command/clinical.py b/lib/seattleflu/id3c/cli/command/clinical.py index 7a599bcb..d0ce300a 100644 --- a/lib/seattleflu/id3c/cli/command/clinical.py +++ b/lib/seattleflu/id3c/cli/command/clinical.py @@ -383,7 +383,7 @@ def parse_kp(kp_filename, kp_specimen_manifest_filename, manifest_format, output All clinical records parsed are output to stdout as newline-delimited JSON records. You will likely want to redirect stdout to a file. """ - clinical_records = pd.read_csv(kp_filename) + clinical_records = pd.read_csv(kp_filename, dtype={'CensusTract': 'string'}) clinical_records.columns = clinical_records.columns.str.lower() clinical_records = trim_whitespace(clinical_records)