From 927a741da6e972825c58e60c28d8cdd01fa20547 Mon Sep 17 00:00:00 2001 From: "J.M. Dana" Date: Fri, 4 Oct 2013 13:28:03 +0100 Subject: [PATCH] Directory "ch01/../data" doesn't exist ch01/data has been created so the .tsv file is generated there --- ch01/analyze_webstats.py | 2 +- ch01/{ => data}/web_traffic.tsv | 16 ++++++++-------- ch01/gen_webstats.py | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) rename ch01/{ => data}/web_traffic.tsv (98%) diff --git a/ch01/analyze_webstats.py b/ch01/analyze_webstats.py index ccd8fe7c..1fed6e9b 100644 --- a/ch01/analyze_webstats.py +++ b/ch01/analyze_webstats.py @@ -10,7 +10,7 @@ import matplotlib.pyplot as plt data_dir = os.path.join( - os.path.dirname(os.path.realpath(__file__)), "..", "data") + os.path.dirname(os.path.realpath(__file__)), ".", "data") data = sp.genfromtxt(os.path.join(data_dir, "web_traffic.tsv"), delimiter="\t") print(data[:10]) diff --git a/ch01/web_traffic.tsv b/ch01/data/web_traffic.tsv similarity index 98% rename from ch01/web_traffic.tsv rename to ch01/data/web_traffic.tsv index 68d4b561..a9b7dcda 100644 --- a/ch01/web_traffic.tsv +++ b/ch01/data/web_traffic.tsv @@ -1,5 +1,5 @@ 1 2272 -2 nan +2 1656 3 1386 4 1365 5 1488 @@ -20,7 +20,7 @@ 20 1246 21 1071 22 1876 -23 nan +23 1402 24 1410 25 925 26 1533 @@ -45,7 +45,7 @@ 45 1723 46 2160 47 808 -48 nan +48 1322 49 1324 50 1809 51 1933 @@ -92,7 +92,7 @@ 92 1216 93 981 94 1345 -95 nan +95 2159 96 1667 97 730 98 1034 @@ -151,7 +151,7 @@ 151 1606 152 1065 153 1291 -154 nan +154 1369 155 1495 156 1928 157 2249 @@ -177,8 +177,8 @@ 177 1578 178 1872 179 1669 -180 nan -181 nan +180 2454 +181 1484 182 1407 183 1619 184 894 @@ -207,7 +207,7 @@ 207 1329 208 1781 209 1242 -210 nan +210 1286 211 1454 212 1501 213 875 diff --git a/ch01/gen_webstats.py b/ch01/gen_webstats.py index 570f7fe6..a1d9ce54 100644 --- a/ch01/gen_webstats.py +++ b/ch01/gen_webstats.py @@ -34,7 +34,7 @@ plt.savefig(os.path.join("..", "1400_01_01.png")) data_dir = os.path.join( - os.path.dirname(os.path.realpath(__file__)), "..", "data") + os.path.dirname(os.path.realpath(__file__)), ".", "data") # sp.savetxt(os.path.join("..", "web_traffic.tsv"), # zip(x[~y.mask],y[~y.mask]), delimiter="\t", fmt="%i")