home
·
contact
·
privacy
projects
/
berlin-corona-table
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6771de0
)
Map abbrevations to long forms.
author
Christian Heller
<c.heller@plomlompom.de>
Fri, 3 Jul 2020 18:56:02 +0000
(20:56 +0200)
committer
Christian Heller
<c.heller@plomlompom.de>
Fri, 3 Jul 2020 18:56:02 +0000
(20:56 +0200)
enhance_table.py
patch
|
blob
|
history
diff --git
a/enhance_table.py
b/enhance_table.py
index 02a7ac9b30b8cd0375a79a49468e2dc5c19e3d77..0482bdfbffbf8fe0e89bb174454b04f561318a92 100755
(executable)
--- a/
enhance_table.py
+++ b/
enhance_table.py
@@
-17,6
+17,23
@@
district_pops = {
'sum': 3754418,
}
'sum': 3754418,
}
+# Map abbreviations to full names.
+translate = {
+ 'CW': 'Charlottenburg-Wilmersdorf',
+ 'FK': 'Friedrichshain-Kreuzberg',
+ 'Li': 'Lichtenberg',
+ 'MH': 'Marzahn-Hellersdorf',
+ 'Mi': 'Mitte',
+ 'Ne': 'Neukölln',
+ 'Pa': 'Pankow',
+ 'Re': 'Reinickendorf',
+ 'Sp': 'Spandau',
+ 'SZ': 'Steglitz-Zehlendorf',
+ 'TS': 'Tempelhof-Schöneberg',
+ 'TK': 'Treptow-Köpenick',
+ 'sum': 'all of Berlin',
+}
+
# Read infections table path and output type.
import sys
if len(sys.argv) != 3:
# Read infections table path and output type.
import sys
if len(sys.argv) != 3:
@@
-156,21
+173,10
@@
elif output_type == 'txt':
Updated daily around 9pm.
Abbrevations/explanations:
Updated daily around 9pm.
Abbrevations/explanations:
-
-CW: Charlottenburg-Wilmersdorf
-FK: Friedrichshain-Kreuzberg
-Li: Lichtenberg
-MH: Marzahn-Hellersdorf
-Mi: Mitte
-Ne: Neukölln
-Pa: Pankow
-Re: Reinickendorf
-Sp: Spandau
-SZ: Steglitz-Zehlendorf
-TS: Tempelhof-Schöneberg
-TK: Treptow-Köpenick
-sum: sum for all the districts
-wsum: sum for last 7 days
+"""
+ for k in translate:
+ intro += "%s: %s\n" % (k, translate[k])
+ intro += """wsum: sum for last 7 days
wavg: per-day average of new infections for last 7 days
winc: incidence (x per 100k inhabitants) of new infections for last 7 days
wavg: per-day average of new infections for last 7 days
winc: incidence (x per 100k inhabitants) of new infections for last 7 days