Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mooc-rr
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
3e6bf7b47a05a05ae3d6af86121dcb5d
mooc-rr
Commits
489fbe96
Commit
489fbe96
authored
Apr 09, 2020
by
François Févotte
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Covid-19: UK à la place de Belgique
parent
e606a522
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
28 deletions
+33
-28
daily.png
module2/exo4/daily.png
+0
-0
exercice_python_fr.org
module2/exo4/exercice_python_fr.org
+33
-28
total.png
module2/exo4/total.png
+0
-0
No files found.
module2/exo4/daily.png
View replaced file @
e606a522
View file @
489fbe96
82.8 KB
|
W:
|
H:
90.6 KB
|
W:
|
H:
2-up
Swipe
Onion skin
module2/exo4/exercice_python_fr.org
View file @
489fbe96
...
...
@@ -100,51 +100,55 @@ En pratique, on prend
# Parameters
column = "total_deaths"
threshold = 100
countries = ["
France", "Italy", "Spain", "Belgiu
m", "Germany", "Switzerland"]
countries = ["
Italy", "Spain", "France", "United Kingdo
m", "Germany", "Switzerland"]
total = {}
for country in countries:
total[country] = data_raw.query(f"location == '{country}' & {column} > {threshold}")
total[countries[
0
]]
total[countries[
2
]]
#+END_SRC
#+RESULTS:
#+begin_example
location new_cases new_deaths total_cases total_deaths
date
2020-03-16 France 924 36 5423 127
2020-03-17 France 1210 21 6633 148
2020-03-18 France 1097 27 7730 175
2020-03-19 France 1404 69 9134 244
2020-03-20 France 1861 128 10995 372
2020-03-21 France 1617 78 12612 450
2020-03-22 France 1847 112 14459 562
2020-03-23 France 1559 112 16018 674
2020-03-24 France 3838 186 19856 860
2020-03-25 France 2446 240 22302 1100
2020-03-26 France 2931 231 25233 1331
2020-03-27 France 3922 365 29155 1696
2020-03-28 France 3809 299 32964 1995
2020-03-29 France 4611 319 37575 2314
2020-03-30 France 2599 292 40174 2606
2020-03-31 France 4376 418 44550 3024
2020-04-01 France 7578 499 52128 3523
2020-04-02 France 4861 509 56989 4032
2020-04-03 France 2116 471 59105 4503
2020-04-04 France 5233 2004 64338 6507
2020-04-05 France 4267 1053 68605 7560
2020-04-06 France 1873 518 70478 8078
2020-04-07 France 3912 833 74390 8911
2020-04-08 France 3777 1417 78167 10328
2020-03-14 Spain 1227 37 4231 121
2020-03-15 Spain 1522 15 5753 136
2020-03-16 Spain 2000 152 7753 288
2020-03-17 Spain 1438 21 9191 309
2020-03-18 Spain 1987 182 11178 491
2020-03-19 Spain 2538 107 13716 598
2020-03-20 Spain 3431 169 17147 767
2020-03-21 Spain 2833 235 19980 1002
2020-03-22 Spain 4946 324 24926 1326
2020-03-23 Spain 3646 394 28572 1720
2020-03-24 Spain 4517 462 33089 2182
2020-03-25 Spain 6584 514 39673 2696
2020-03-26 Spain 7937 738 47610 3434
2020-03-27 Spain 8578 655 56188 4089
2020-03-28 Spain 7871 769 64059 4858
2020-03-29 Spain 8189 832 72248 5690
2020-03-30 Spain 6549 838 78797 6528
2020-03-31 Spain 6398 812 85195 7340
2020-04-01 Spain 9222 849 94417 8189
2020-04-02 Spain 7719 864 102136 9053
2020-04-03 Spain 8102 950 110238 10003
2020-04-04 Spain 7472 932 117710 10935
2020-04-05 Spain 7026 809 124736 11744
2020-04-06 Spain 6023 674 130759 12418
2020-04-07 Spain 4273 637 135032 13055
2020-04-08 Spain 5478 743 140510 13798
2020-04-09 Spain 6180 757 146690 14555
#+end_example
#+BEGIN_SRC python :session :results output file :exports results :var pltfile="total.png"
plt.figure(figsize=(10,5))
for country in total.keys():
x = total[country][
'total_deaths'
]
x = total[country][
column
]
plt.plot(np.arange(len(x)), x, label=country, linewidth=3)
plt.xlabel(f"Number of days since {column} > {threshold}")
plt.ylabel(column)
plt.yscale("log")
plt.legend(fontsize='x-large')
plt.tight_layout()
...
...
@@ -171,7 +175,7 @@ de morts dépasse 15.
for country in countries:
daily[country] = data_raw.query(f"location == '{country}' & new_deaths > {threshold}")
daily[countries[
0
]]
daily[countries[
2
]]
#+END_SRC
#+RESULTS:
...
...
@@ -215,6 +219,7 @@ du 01/02 (/cf./ [[https://www.gouvernement.fr/info-coronavirus/carte-et-donnees]
x = daily[country]['new_deaths']
plt.plot(np.arange(len(x)), x, label=country, linewidth=3)
plt.xlabel(f"Number of days since daily deaths > {threshold}")
plt.ylabel("Dealy death rate")
plt.yscale("log")
plt.legend(fontsize='x-large')
plt.tight_layout()
...
...
module2/exo4/total.png
View replaced file @
e606a522
View file @
489fbe96
60.6 KB
|
W:
|
H:
65.6 KB
|
W:
|
H:
2-up
Swipe
Onion skin
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