Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Chris Jewell
covid19uk
Commits
876ee171
Commit
876ee171
authored
Apr 11, 2021
by
Chris Jewell
Browse files
Corrected bug in case download code
parent
ef4794bd
Changes
1
Hide whitespace changes
Inline
Side-by-side
covid/data/case_data.py
View file @
876ee171
...
...
@@ -69,8 +69,7 @@ class CasesData:
"""
Format as per linelisting
"""
columns
=
[
"pillar"
,
"LTLA_code"
,
"specimen_date"
,
"lab_report_date"
]
dfs
=
pd
.
read_csv
(
file
,
chunksize
=
50000
,
iterator
=
True
,
usecols
=
columns
)
dfs
=
pd
.
read_csv
(
file
,
chunksize
=
50000
,
iterator
=
True
)
df
=
pd
.
concat
(
dfs
)
return
df
...
...
@@ -164,6 +163,8 @@ class CasesData:
"""
Adapt the line listing data to the desired dataframe format.
"""
df
=
df
[[
"pillar"
,
"LTLA_code"
,
"specimen_date"
,
"lab_report_date"
]]
# Clean missing values
df
.
dropna
(
inplace
=
True
)
df
=
df
.
rename
(
columns
=
{
"LTLA_code"
:
"lad19cd"
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment