Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
24 lines (19 sloc) 721 Bytes
using DataFrames
using Datetime
using Gadfly
# All current reports
# wget
data = readtable("reports.csv")
# Parse date strings into the hour of day (0-23)
formatter = "yyyy-MM-ddTHH:mm:ss"
function hourofday(d::String)
Datetime.hour(Datetime.datetime(formatter, d))
@vectorize_1arg String hourofday
@transform(data, Hour => hourofday(End))
# Group by Neighborhood; strip unclassified reports
results = by(data, ["Neighborhood", "Hour"], nrow)
# Plot and draw!
p = plot(results, y="x1", x="Hour", color="Neighborhood", Guide.XLabel("Hour of Day"), Guide.YLabel("Number of Reports"),
draw(SVG("results.svg", 9inch, 9inch), p)