From 0b5d6523df0176b4ac76703b6fb7bf5d4aa85d29 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Fri, 29 May 2020 11:46:33 -0700 Subject: metadata parse: new column titles --- fatcat_covid19/parse.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fatcat_covid19/parse.py b/fatcat_covid19/parse.py index ce2bf26..aea3d25 100644 --- a/fatcat_covid19/parse.py +++ b/fatcat_covid19/parse.py @@ -14,8 +14,10 @@ def parse_cord19_file(csv_path, json_output): reader = csv.DictReader(csvfile) for row in reader: row = dict(row) - row['mag_id'] = row.pop('Microsoft Academic Paper ID') - row['who_covidence_id'] = row.pop('WHO #Covidence').replace('#', '') + # Previously had to rename these columns + #row['mag_id'] = row.pop('Microsoft Academic Paper ID') + #row['who_covidence_id'] = row.pop('WHO #Covidence').replace('#', '') + row['who_covidence_id'] = row['who_covidence_id'].replace('#', '') obj = dict(cord19_paper=row) print(json.dumps(obj, sort_keys=True), file=json_output) -- cgit v1.2.3