|
4 | 4 | "cell_type": "markdown", |
5 | 5 | "metadata": {}, |
6 | 6 | "source": [ |
7 | | - "# Chapter 13: CSV and plotting\n", |
| 7 | + "#Chapter 12 : CSV and plotting\n", |
8 | 8 | "\n", |
9 | 9 | "*Data Processing with Python, a course for Communication and Information Sciences*\n", |
10 | 10 | "\n", |
|
232 | 232 | "outputs": [], |
233 | 233 | "source": [ |
234 | 234 | "import csv\n", |
235 | | - "f=open(\"coffee.csv\")\n", |
| 235 | + "f=open(\"data/coffee.csv\")\n", |
236 | 236 | "for row in csv.reader(f):\n", |
237 | 237 | " print(row)" |
238 | 238 | ] |
|
277 | 277 | "outputs": [], |
278 | 278 | "source": [ |
279 | 279 | "import csv\n", |
280 | | - "f = open(\"airports.csv\" , encoding='utf-8')\n", |
| 280 | + "f = open(\"data/airports.csv\" , encoding='utf-8')\n", |
281 | 281 | "for row in csv.reader(f):\n", |
282 | 282 | " print(row[1])" |
283 | 283 | ] |
|
306 | 306 | "\n", |
307 | 307 | "airport_counts={}\n", |
308 | 308 | "\n", |
309 | | - "f = open(\"airports.csv\" , encoding='utf-8')\n", |
| 309 | + "f = open(\"data/airports.csv\" , encoding='utf-8')\n", |
310 | 310 | "for row in csv.reader(f):\n", |
311 | 311 | " key = row[3]\n", |
312 | 312 | " if key in airport_counts: \n", |
|
357 | 357 | "source": [ |
358 | 358 | "latitudes = {}\n", |
359 | 359 | "longitudes = {}\n", |
360 | | - "f = open(\"airports.csv\", encoding='utf-8')\n", |
| 360 | + "f = open(\"data/airports.csv\", encoding='utf-8')\n", |
361 | 361 | "for row in csv.reader(f):\n", |
362 | 362 | " airport_id = row[0]\n", |
363 | 363 | " latitudes[airport_id] = float(row[6])\n", |
|
441 | 441 | "outputs": [], |
442 | 442 | "source": [ |
443 | 443 | "distances = []\n", |
444 | | - "f = open(\"routes.csv\")\n", |
| 444 | + "f = open(\"data/routes.csv\")\n", |
445 | 445 | "for row in csv.reader(f):\n", |
446 | 446 | " source_airport = row[3]\n", |
447 | 447 | " dest_airport = row[5]\n", |
|
0 commit comments