--- /dev/null
+"""
+
+hello_plot.py
+
+A first plot with matplotlib
+
+"""
+
+import matplotlib.pyplot as plt
+figure = plt.figure()
+axis = figure.add_subplot(111)
+plt.plot([1,2,3], [1,2,3])
+plt.show()
Using this dataset requires that you first download the following dataset:
-http://communitydata.cc/~mako/wikipedia_bios.csv
-
+http://communitydata.cc/~mako/hp_wiki.tsv
--- /dev/null
+""" load_hp_data.py
+
+A module for loading data from the Harry Potter wikipedia data set
+
+"""
+import csv
+from datetime import datetime
+
+f = open('hp_wiki.tsv', 'r')
+reader = csv.DictReader(f, delimiter='\t')
+
+columns = {}
+for fieldname in reader.fieldnames:
+ columns[fieldname] = []
+
+
+rows = []
+for row in reader:
+ # Convert timestamp from a string to a date:
+ row['timestamp'] = datetime.strptime(row['timestamp'], '%Y-%m-%d %H:%M:%S')
+ rows.append(row)
+ for fieldname, value in row.items():
+ columns[fieldname].append(value)
\ No newline at end of file