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
79fc9cd1
Commit
79fc9cd1
authored
3 years ago
by
Arshana Jain
Browse files
Options
Downloads
Patches
Plain Diff
daily europe - github
parent
30cc3cf2
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
daily_data_scripts/daily_europe.py
+38
-0
38 additions, 0 deletions
daily_data_scripts/daily_europe.py
initial_data_scripts/init_europe.py
+0
-1
0 additions, 1 deletion
initial_data_scripts/init_europe.py
with
38 additions
and
1 deletion
daily_data_scripts/daily_europe.py
+
38
−
0
View file @
79fc9cd1
import
pandas
as
pd
import
datetime
# Use this for European countries only. Other countries appear to be either unreliable or have a lot of holes in their data.
def
init_jrc
():
df
=
pd
.
read_csv
(
'
https://raw.githubusercontent.com/ec-jrc/COVID-19/master/data-by-region/jrc-covid-19-regions-latest.csv
'
,
error_bad_lines
=
False
)
# JRC includes Germany data, but not the same subsets
def
init_germany
():
pass
# JRC includes UK data, but not the same subsets
def
init_uk
():
pass
# JRC includes Italy data, but not the same subsets
def
init_italy
():
df_total
=
pd
.
read_csv
(
'
https://raw.githubusercontent.com/RamiKrispin/covid19Italy/master/csv/italy_total.csv
'
,
error_bad_lines
=
False
)
df_region
=
pd
.
read_csv
(
'
https://raw.githubusercontent.com/RamiKrispin/covid19Italy/master/csv/italy_region.csv
'
,
error_bad_lines
=
False
)
df_subregion
=
pd
.
read_csv
(
'
https://raw.githubusercontent.com/RamiKrispin/covid19Italy/master/csv/italy_province.csv
'
,
error_bad_lines
=
False
)
# Updates daily. Check for both yesterday's and today's data to make sure they are both gotten regardless of when the source is updated
def
init_ukraine
():
dt
=
datetime
.
datetime
.
today
()
csv_name_today
=
'
https://raw.githubusercontent.com/dmytro-derkach/covid-19-ukraine/master/daily_reports/
'
+
(
'
0
'
if
dt
.
month
<
10
else
''
)
+
str
(
dt
.
month
)
+
'
-
'
+
(
'
0
'
if
dt
.
day
<
10
else
''
)
+
str
(
dt
.
day
)
+
'
-
'
+
str
(
dt
.
year
)
+
'
.csv
'
dt
-=
datetime
.
timedelta
(
days
=
1
)
csv_name_yesterday
=
'
https://raw.githubusercontent.com/dmytro-derkach/covid-19-ukraine/master/daily_reports/
'
+
(
'
0
'
if
dt
.
month
<
10
else
''
)
+
str
(
dt
.
month
)
+
'
-
'
+
(
'
0
'
if
dt
.
day
<
10
else
''
)
+
str
(
dt
.
day
)
+
'
-
'
+
str
(
dt
.
year
)
+
'
.csv
'
try
:
df_yesterday
=
pd
.
read_csv
(
csv_name_yesterday
,
error_bad_lines
=
False
)
except
:
pass
try
:
df_today
=
pd
.
read_csv
(
csv_name_today
,
error_bad_lines
=
False
)
except
:
pass
def
init_france
():
pass
This diff is collapsed.
Click to expand it.
initial_data_scripts/init_europe.py
+
0
−
1
View file @
79fc9cd1
...
...
@@ -34,4 +34,3 @@ def init_ukraine():
def
init_france
():
pass
init_ukraine
()
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