Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
COVID-19-Data-Integration
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ivy Wang
COVID-19-Data-Integration
Commits
f35ee9e9
Commit
f35ee9e9
authored
2 years ago
by
Arshana Jain
Browse files
Options
Downloads
Patches
Plain Diff
add type cast
parent
a064831f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
daily_data_scripts/daily_europe.py
+4
-4
4 additions, 4 deletions
daily_data_scripts/daily_europe.py
with
4 additions
and
4 deletions
daily_data_scripts/daily_europe.py
+
4
−
4
View file @
f35ee9e9
...
...
@@ -149,9 +149,9 @@ def daily_italy():
sql
=
'''
INSERT INTO Cases_Per_Country (country_code, date_collected, source_id, death_numbers, case_numbers, recovery_numbers, hospitalization_numbers) VALUES (?, ?, ?, ?, ?, ?, ?)
'''
c
.
execute
(
sql
,(
italy_code
,
row
.
date
,
italy_src
,
(
row
.
death
-
prev_death
)
if
isNum
(
row
.
death
)
else
None
,
int
(
row
.
daily_positive_cases
)
if
isNum
(
row
.
daily_positive_cases
)
else
None
,
(
row
.
recovered
-
prev_recovered
)
if
isNum
(
row
.
recovered
)
else
None
,
int
(
row
.
total_hospitalized
)
if
isNum
(
row
.
total_hospitalized
)
else
None
))
if
isNum
(
row
.
death
):
prev_row
[
"
death
"
]
=
row
.
death
prev_row
[
"
death
"
]
=
int
(
row
.
death
)
if
isNum
(
row
.
recovered
):
prev_row
[
"
recovered
"
]
=
row
.
recovered
prev_row
[
"
recovered
"
]
=
int
(
row
.
recovered
)
conn
.
commit
()
dt
+=
datetime
.
timedelta
(
days
=
1
)
...
...
@@ -177,9 +177,9 @@ def daily_italy():
sql
=
'''
INSERT INTO Cases_Per_Region (region_code, date_collected, source_id, death_numbers, case_numbers, recovery_numbers, hospitalization_numbers) VALUES (?, ?, ?, ?, ?, ?, ?)
'''
c
.
execute
(
sql
,(
region_code
,
row
.
date
,
italy_src
,
(
row
.
death
-
prev_death
)
if
isNum
(
row
.
death
)
else
None
,
int
(
row
.
daily_positive_cases
)
if
isNum
(
row
.
daily_positive_cases
)
else
None
,
(
row
.
recovered
-
prev_recovered
)
if
isNum
(
row
.
recovered
)
else
None
,
int
(
row
.
total_hospitalized
)
if
isNum
(
row
.
total_hospitalized
)
else
None
))
if
isNum
(
row
.
death
):
prev_death_dict
[
region_code
]
=
row
.
death
prev_death_dict
[
region_code
]
=
int
(
row
.
death
)
if
isNum
(
row
.
recovered
):
prev_recovered_dict
[
region_code
]
=
row
.
recovered
prev_recovered_dict
[
region_code
]
=
int
(
row
.
recovered
)
conn
.
commit
()
dt
+=
datetime
.
timedelta
(
days
=
1
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment