From 4661448c6b469b611dc8abd00e94e67dd0b1b840 Mon Sep 17 00:00:00 2001 From: Dorinel Bastide Date: Wed, 15 Jul 2020 22:44:59 +0200 Subject: [PATCH] Recommited for correcting the table display part now working --- module3/exo1/influenza-like-illness-analysis.org | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/module3/exo1/influenza-like-illness-analysis.org b/module3/exo1/influenza-like-illness-analysis.org index a37cd03..57dc752 100644 --- a/module3/exo1/influenza-like-illness-analysis.org +++ b/module3/exo1/influenza-like-illness-analysis.org @@ -82,7 +82,8 @@ if not os.path.exists(data_file): #+END_SRC #+BEGIN_SRC python :results silent :var data_url=data-url -data = urlopen(data_url).read() +#data = urlopen(data_url).read() +data = open(data_file, 'rb').read() lines = data.decode('latin-1').strip().split('\n') data_lines = lines[1:] table = [line.split(',') for line in data_lines] @@ -94,6 +95,11 @@ table[:5] #+END_SRC #+RESULTS: +| week | indicator | inc | inc_low | inc_up | inc100 | inc100_low | inc100_up | geo_insee | geo_name | +| 202011 | 3 | 101704 | 93652 | 109756 | 154 | 142 | 166 | FR | France | +| 202010 | 3 | 104977 | 96650 | 113304 | 159 | 146 | 172 | FR | France | +| 202009 | 3 | 110696 | 102066 | 119326 | 168 | 155 | 181 | FR | France | +| 202008 | 3 | 143753 | 133984 | 153522 | 218 | 203 | 233 | FR | France | ** Checking for missing data Unfortunately there are many ways to indicate the absence of a data value in a dataset. Here we check for a common one: empty fields. For completeness, we should also look for non-numerical data in numerical columns. We don't do this here, but checks in later processing steps would catch such anomalies. -- 2.18.1