COVID-19/All-cause deaths/Japan
Appearance
Weekly all-cause deaths in Japan, based on exdeaths-japan.org data, Observed.csv:
Graphs are unavailable due to a known technical issue. Updates on reimplementing the Graph extension can be found on Phabricator and on MediaWiki.org. |
Script plotJapan.py:
import sys, csv, datetime
fileName = sys.argv[1] # e.g. "Observed.csv"
data = {}
for line in csv.reader(open(fileName)):
if "prefecture_id" not in line[0]:
dateStr = line[3]
if "-" in dateStr:
date = datetime.datetime.strptime(dateStr, "%d-%b-%y") # e.g. 10-Jan-10
else:
date = datetime.datetime.strptime(dateStr, "%d%b%Y") # e.g. 10jan2010
deaths = int(line[5])
if not date in data:
data[date] = 0
data[date] += deaths
data = data.items()
data.sort(key=lambda x: x[0])
datesOut = ", ".join([k.strftime("%Y-%m-%d") for k, v in data])
deathsOut = ", ".join([str(v) for k, v in data])
sys.stdout.write("|x =" + datesOut + "\n")
sys.stdout.write("|y =" + deathsOut + "\n")
Script oneliner to update the chart:
- plotJapan.py Observed.csv
External links:
- Excess and Exiguous Deaths Dashboard in Japan, exdeaths-japan.org
- W:COVID-19 pandemic in Japan, wikipedia.org