Faces and Earthquakes

Baby’s first hair-sway


import csv
def setup():
size(800, 500)

with open("quakes.csv") as f:
reader = csv.reader(f)
header = reader.next() # Skip the header row.

#print header

global times
times = []
global magnitudes
magnitudes = []

for row in reader:
time = float(row[0])
magnitude = float(row[4])
#print times
#print magnitudes
def draw():
#text("time", width/2, 350)
#print times[0]
#print magnitudes[0]
x = 0
for magnitude in magnitudes:
line(magnitude, times[x]*20, magnitude*50, times[x]*20)
x += 1

the x axis represents magnitude of the earthquake (the longer, the stronger the magnitude)

the y-axis represents the time it was recorded: I edited the original data set to show time as a float (rather than day:hour:minute)

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.