Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente Prochaine révision Les deux révisions suivantes | ||
python:first_course_statistics [2016/10/08 09:11] Francesco Beretta [Eruptions of the Old Faithful geyser (p.5)] |
python:first_course_statistics [2016/10/08 13:24] Beretta, Anna Letizia |
||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | ====== Lessons ====== | ||
- | ===== Eruptions of the "Old Faithful" geyser (p.5) ===== | + | ====== Eruptions of the "Old Faithful" geyser (p.5) ====== |
- | ==== Histogram (p.5) ==== | + | ===== Histogram (p.5) ===== |
+ | |||
+ | This is my first function. | ||
<code python> | <code python> | ||
# fake code – to be deleted | # fake code – to be deleted | ||
import csv | import csv | ||
- | filename = 'ch02-data.csv' | + | |
- | f = open(filename) | + | csvfile = open('D:\data-wrangling-master\data-wrangling-master\data\chp3\data-text.csv', 'rb') |
- | data = [] | + | reader = csv.reader(csvfile) |
- | reader = csv.reader(f) | + | |
- | header = reader.next() | + | for row in reader: |
- | data = [row for row in reader] | + | print(row) |
- | for datarow in data: | + | |
- | print datarow | + | |
</code> | </code> | ||
- | ===== International adoption rates (p.13) ===== | + | ====== International adoption rates (p.13) ====== |