Commit 876ee171 authored by Chris Jewell's avatar Chris Jewell
Browse files

Corrected bug in case download code

parent ef4794bd
...@@ -69,8 +69,7 @@ class CasesData: ...@@ -69,8 +69,7 @@ class CasesData:
""" """
Format as per linelisting Format as per linelisting
""" """
columns = ["pillar", "LTLA_code", "specimen_date", "lab_report_date"] dfs = pd.read_csv(file, chunksize=50000, iterator=True)
dfs = pd.read_csv(file, chunksize=50000, iterator=True, usecols=columns)
df = pd.concat(dfs) df = pd.concat(dfs)
return df return df
...@@ -164,6 +163,8 @@ class CasesData: ...@@ -164,6 +163,8 @@ class CasesData:
""" """
Adapt the line listing data to the desired dataframe format. Adapt the line listing data to the desired dataframe format.
""" """
df = df[["pillar", "LTLA_code", "specimen_date", "lab_report_date"]]
# Clean missing values # Clean missing values
df.dropna(inplace=True) df.dropna(inplace=True)
df = df.rename(columns={"LTLA_code": "lad19cd"}) df = df.rename(columns={"LTLA_code": "lad19cd"})
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment