This repository has been archived by the owner on May 7, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBeijing.py
67 lines (59 loc) · 6.36 KB
/
Beijing.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
63
64
65
66
67
### Project: 2020Wuhan@Github/Ginchung
## File: beijing.py
## Run with 'python beijing.py'
# object 'sdct'
# Function: stores the info from official message
# Key: YYYY-MM-DD-HH
# Web source: http://wjw.beijing.gov.cn/wjwh/ztzl/xxgzbd/gzbdyqtb/
province='beijing'
sdct={}
sdct['2020-01-21-18']='西城区1例、海淀区2例、丰台区1例、通州区1例、大兴区2例、昌平区2例,武汉来京人员1例'
sdct['2020-01-22-18']='西城区2例、朝阳区1例、海淀区2例、丰台区1例、石景山区1例、通州区1例、大兴区2例、昌平区2例,武汉来京人员2例'
sdct['2020-01-24-00']='西城区3例、朝阳区3例、海淀区3例、丰台区2例、石景山区1例、通州区2例、顺义区1例、大兴区2例、昌平区2例,外地来京人员7例'
sdct['2020-01-24-17']='西城区4例、朝阳区5例、海淀区4例、丰台区2例、石景山区1例、通州区2例、顺义区1例、大兴区2例、昌平区3例,外地来京人员10例'
sdct['2020-01-24-20']='西城区4例、朝阳区5例、海淀区6例、丰台区2例、石景山区1例、通州区2例、顺义区1例、大兴区2例、昌平区3例,外地来京人员10例'
sdct['2020-01-25-17']='西城区4例、朝阳区6例、海淀区8例、丰台区2例、石景山区1例、通州区3例、顺义区1例、大兴区2例、昌平区3例,外地来京人员11例'
sdct['2020-01-25-23']='东城区1例、西城区5例、朝阳区8例、海淀区10例、丰台区3例、石景山区1例、通州区4例、顺义区1例、大兴区2例、昌平区5例,外地来京人员11例'
sdct['2020-01-26-08']='东城区1例、西城区5例、朝阳区8例、海淀区13例、丰台区3例、石景山区1例、通州区4例、顺义区1例、大兴区2例、昌平区5例,外地来京人员11例'
sdct['2020-01-26-21']='东城区1例、西城区5例、朝阳区11例、海淀区16例、丰台区4例、石景山区2例、通州区6例、顺义区1例、大兴区3例、昌平区7例,外地来京人员12例'
sdct['2020-01-27-09']='东城区1例、西城区7例、朝阳区11例、海淀区17例、丰台区4例、石景山区2例、通州区6例、顺义区1例、大兴区5例、昌平区7例,外地来京人员11例'
sdct['2020-01-27-20']='东城区2例、西城区7例、朝阳区17例、海淀区17例、丰台区4例、石景山区2例、通州区7例、顺义区1例、大兴区5例、昌平区7例,外地来京人员11例'
sdct['2020-01-28-12']='东城区2例、西城区8例、朝阳区17例、海淀区21例、丰台区7例、石景山区2例、通州区7例、顺义区2例、大兴区7例、昌平区7例,外地来京人员11例'
sdct['2020-01-29-12']='东城区2例、西城区9例、朝阳区19例、海淀区23例、丰台区8例、石景山区2例、门头沟1例、通州区7例、顺义区2例、大兴区10例、昌平区8例,外地来京人员11例'
sdct['2020-01-29-20']='东城区2例、西城区12例、朝阳区21例、海淀区24例、丰台区10例、石景山区2例、门头沟区1例、通州区8例、顺义区2例、大兴区10例、昌平区8例,外地来京人员11例'
sdct['2020-01-30-08']='东城区2例、西城区12例、朝阳区21例、海淀区24例、丰台区11例、石景山区2例、门头沟区1例、通州区8例、顺义区2例、大兴区10例、昌平区9例、怀柔区1例,外地来京人员11例'
sdct['2020-01-30-20']='东城区2例、西城区12例、朝阳区21例、海淀区24例、丰台区11例、石景山区2例、门头沟区1例、通州区10例、顺义区2例、大兴区15例、昌平区9例、怀柔区1例,外地来京人员11例'
sdct['2020-01-31-00']='东城区3例、西城区13例、朝阳区22例、海淀区26例、丰台区11例、石景山区2例、门头沟区1例、通州区12例、顺义区2例、大兴区16例、昌平区12例、怀柔区1例,外地来京人员11例'
sdct['2020-01-31-14']='东城区3例、西城区16例、朝阳区24例、海淀区27例、丰台区11例、石景山区2例、门头沟区1例、通州区12例、顺义区2例、大兴区17例、昌平区12例、怀柔区1例,外地来京人员11例'
sdct['2020-02-01-00']='东城区3例、西城区17例、朝阳区27例、海淀区35例、丰台区12例、石景山区3例、门头沟区1例、通州区13例、顺义区2例、大兴区19例、昌平区12例、怀柔区1例,外地来京人员11例'
sdct['2020-02-01-12']='东城区3例、西城区17例、朝阳区28例、海淀区39例、丰台区16例、石景山区3例、门头沟区1例、房山区2例、通州区13例、顺义区2例、昌平区12例、大兴区20例、怀柔区1例、外地来京人员11例'
sdct['2020-02-02-00']='东城区3例、西城区17例、朝阳区35例、海淀区41例、丰台区16例、石景山区4例、门头沟区1例、房山区2例、通州区13例、顺义区6例、昌平区12例、大兴区21例、怀柔区1例、外地来京人员11例'
sdct['2020-02-03-00']='东城区2例、西城区26例、朝阳区31例、海淀区42例、丰台区17例、石景山区5例、门头沟区3例、房山区4例、通州区13例、顺义区5例、昌平区13例、大兴区28例、怀柔区3例、延庆区1例,外地来京人员19例'
sdct['2020-02-04-00']='东城区2例、西城区28例、朝阳区36例、海淀区45例、丰台区18例、石景山区6例、门头沟区3例、房山区5例、通州区13例、顺义区5例、昌平区14例、大兴区29例、怀柔区3例、延庆区1例,外地来京人员20例'
sdct['2020-02-05-00']='东城区6例、西城区29例、朝阳区43例、海淀区45例、丰台区20例、石景山区7例、门头沟区3例、房山区11例、通州区13例、顺义区6例、昌平区15例、大兴区29例、怀柔区4例、延庆区1例,外地来京人员21例'
sdct['2020-02-06-00']=''
city=[]
latest='2020-02-05-00'
for i in sdct[latest].replace(',','、').split('、'):
city.append(i[:2])
print('city of %s: '%province,city,'\n')
print('number of infected cities now: ',len(city))
Table={}
for k,v in zip(sdct.keys(),sdct.values()):
if len(v)<5:
continue
s=['0']*len(city)
v=v.replace(',','、').replace('武汉','外地')
for i in v.split('、'):
tmp=''
for t in i:
if t.isdigit():
tmp+=t
#tmp=int(tmp)
s[city.index(i[:2])]=tmp
Table[k]=s
print(s)
### Output
print(province,',',','.join(city))
for date,out in zip(Table.keys(),Table.values()):
print(date,',',','.join(out))