Skip to content

Instantly share code, notes, and snippets.

@emperorcezar
Created November 29, 2010 21:58
Show Gist options
  • Save emperorcezar/720708 to your computer and use it in GitHub Desktop.
Save emperorcezar/720708 to your computer and use it in GitHub Desktop.
data = sorted(data)
times = {}
for single in data:
try:
times[single] += 1
except KeyError:
times[single] = 1
graph_data = [[k, v] for k, v in times.iteritems()]
graph_data = sorted(graph_data, key=lambda d: d[0])
graph_data = simplejson.dumps(graph_data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment