In [ ]:
%pylab inline
import json
def filternan(x):
return x[isnan(x) != True]
In [1]:
with open("out.json") as f:
rows = [json.loads(row) for row in f]
keys = set()
for row in rows: keys.update(set(row.keys()))
d = zeros(len(rows), dtype=[(str(name), 'f4') for name in keys])
for idx, row in enumerate(rows):
for key in keys:
d[idx][key] = nan
try:
d[idx][key] = float(row[key])
except:
pass
In [27]:
histfig = figure(figsize=(20,5))
subplot = histfig.add_subplot(111)
subplot.hist(d['measure_new_score'], bins=200, normed=False, color='b', alpha=0.5, label="fishy score")
subplot.hist(d['measure_coursestddev'], bins=200, normed=False, color='r', alpha=0.5, label="course std")
subplot.hist(d['measure_speedstddev'], bins=200, normed=False, color='g', alpha=0.5, label="speed std")
subplot.hist(d['measure_speedavg'], bins=200, normed=False, color='y', alpha=0.5, label="speed avg")
show()
In [37]:
histfig = figure(figsize=(20,5))
subplot = histfig.add_subplot(111)
subplot.hist(filternan(d['speed']), range=(0, 25), bins=200, normed=False, color='b', alpha=0.5, label="raw momentary speed")
legend()
show()
In [42]:
histfig = figure(figsize=(20,5))
subplot = histfig.add_subplot(111)
subplot.hist(filternan(d['measure_speed']), bins=100, normed=False, color='b', alpha=0.5, label="normalized momentary speed")
legend()
show()
In [41]:
histfig = figure(figsize=(20,5))
subplot = histfig.add_subplot(111)
subplot.hist(filternan(d['measure_speedavg']), bins=200, normed=False, color='b', alpha=0.5, label="measure_speedavg")
legend()
show()
In [ ]: