plt.show()
-# Challenge: plot the relationship between edit size. Use
+# Challenge: Is edit size related to how long it's been since the last edit?
+# => Plot the relationship between edit size and the time since the last edit:
-## Hint 1:
+## Hint 1: the number of seconds between two edits is:
-#delta_time1 = hp.columns['timestamp'][1] - hp.columns['timestamp'][0]
+#delta_time1 = (hp.columns['timestamp'][1] - hp.columns['timestamp'][0]).total_seconds()
## Hint 2:
# ax.plot([1,2,3], [2,4,8], '.')
# ax.plot([1,2,3], [2,4,8], 'r.')
+
+# And see online documentation here:
+# http://matplotlib.org/api/pyplot_summary.html
+# http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.plot
+
+
# Maybe don't really need that axis to be so long:
# ax.set_xlim([0, 200000])
-
plt.show()
+
+## Challenge : A 'mega-user' is a user with more than 1000 edits.
+# Plot a bar chart with the maximal edit size for each one of the mega-users
row['size'] = int(row['size'])
rows.append(row)
-# Sort these things, so that they give you nice time-series
+# Sort these things, so that they give you nice ordered time-series
sort_rows = sorted(rows, key=lambda row: row['timestamp'], reverse=False)
rows = sort_rows