-
Notifications
You must be signed in to change notification settings - Fork 0
/
Countries.py
executable file
·62 lines (42 loc) · 1.13 KB
/
Countries.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 25 03:32:34 2020
@author: aozca
"""
import datetime
import requests
from matplotlib import style
from matplotlib import pyplot as plt
from matplotlib.pyplot import figure
url="https://raw.githubusercontent.com/pomber/covid19/master/docs/timeseries.json"
alldata= requests.get(url).json()
figure(num=None, figsize=(55,25), dpi=90, facecolor='w', edgecolor='k')
style.use('ggplot')
title = 'Covid-19 World'
plt.title(title)
plt.xlabel('Dates')
plt.ylabel('Cases')
deaths= []
date = []
confirmed = []
i = 0
for country in alldata:
if country == "US":
continue
for day in alldata[country]:
confirmed.append(day["confirmed"])
date_time_obj = datetime.datetime.strptime(day['date'], '%Y-%m-%d')
date.append( date_time_obj.strftime('%m-%d '))
# if confirmed[-1] < 80000:
# confirmed=[]
# date=[]
# continue
plt.plot(date ,confirmed,label=country)
confirmed=[]
date=[]
# i += 1
# if i > 1:
# break
plt.legend()
plt.show()
#