Class 16 — Wednesday September 29
Web and Dataset Chrestomathics
CVS Drugstore — Is not to be examined — CSV files yes
May the light of peace — For you and your families — Always shine brightly
Look both ways
Agenda
- Dataset processing
- Chrestomathics
Readability
- Recommended practices
Downloads
- Program csv_is_not_a_pharmacy.py
- Program lotta_books.py
- Program where_is_it.py
To do
- Review artifacts
Program csv_is_not_a_pharmacy.py
-
Some program runs
Enter name of dataset: oceania.csv
dataset:
Country, Females, Males
Australia, 11175724, 11092660
Fiji, 421365, 439258
French Polynesia, 132082, 138682
New Caledonia, 125322, 125548
New Zealand, 2223281, 2144855
Papua New Guinea, 3359979, 3498287
Solomon Islands, 259909, 278239
Vanuatu, 117573, 122078
header:
['Country', 'Females', 'Males']
data:
['Country', 'Females', 'Males']
['Australia', 11175724, 11092660]
['Fiji', 421365, 439258]
['French Polynesia', 132082, 138682]
['New Caledonia', 125322, 125548]
['New Zealand', 2223281, 2144855]
['Papua New Guinea', 3359979, 3498287]
['Solomon Islands', 259909, 278239]
['Vanuatu', 117573, 122078]
Enter name of dataset: elevations.csv
dataset:
Location, Author, Max Height, Min Height
Narnia, Lewis, 4810, -10
Neverland, Milne, 426, -2
Oz, Baum, 1231, 679
Sleepy Hollow, Irving, 1629, 304
Stars Hollow, Sherman-Palladino, 725, 152
Toyland, MacDonough, 6187, 0
Wonderland, Carroll, 5895, -5
header:
['Location', 'Author', 'Max Height', 'Min Height']
data:
['Narnia', 'Lewis', 4810, -10]
['Neverland', 'Milne', 426, -2]
['Oz', 'Baum', 1231, 679]
['Sleepy Hollow', 'Irving', 1629, 304]
['Stars Hollow', 'Sherman-Palladino', 725, 152]
['Toyland', 'MacDonough', 6187, 0]
['Wonderland', 'Carroll', 5895, -5]
Program lotta_books.py
- Examines a literal dataset based on the web dataset best_sellers.csv
-
Program run
header: ['Name', 'Author', 'Language', 'Date', 'Sales']
sales column: 4
name column: 0
date column: 3
total sold: 1897000000
dates: [1865, 1939, 1754, 1605, 1997, 1937, 1943, 1954, 1859]
earliest: 1605
latest : 1997
average date: 1872
row with earliest book: 3
row with latest book : 4
info on earliest: ['Don Quixote', 'de Cervantes', 'Spanish', 1605, 500000000]
info on latest: ['Harry Potter', 'Rowling', 'English', 1997, 447000000]
name of earliest: Don Quixote
name of latest: Harry Potter
Program where_is_it.py
- Determines a rough estimate of the center of continental USA by making use of CSV dataset usa-continental.csv
King City, CA, 36.21106, -121.05986
Fischer, TX, 29.960139, -98.21846
Alma, AR, 35.48891, -94.20897
Mount Moriah, MO, 40.30922, -93.794818
Sparkman, AR, 33.91855, -92.80484
Logansport, LA, 31.991863, -93.98356
...
Steeleville, IL, 38.002188, -89.66723
Underwood, IN, 38.603451, -85.76711
Caledonia, ND, 47.472415, -96.8887
Wales, WI, 43.002534, -88.37771
Greenwich, KS, 37.78335, -97.205419
Lansing, WV, 38.079509, -81.06238
- Question
- How should we determine the estimate?
Lebanon, KS, 66952, 39°48′38″N 98°33′22″W