Created
November 29, 2010 21:58
-
-
Save emperorcezar/720708 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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