Skip to content

Instantly share code, notes, and snippets.

@thieman
Created May 26, 2014 00:42
Show Gist options
  • Save thieman/786049112124d15b88a7 to your computer and use it in GitHub Desktop.
Save thieman/786049112124d15b88a7 to your computer and use it in GitHub Desktop.
Overlapping chunks
In [35]: pairs = [(chunk['min']['game_id'], chunk['max']['game_id']) for chunk in chunks]
In [36]: pairs = sorted(pairs, key=itemgetter(1))
In [37]: for idx, pair in enumerate(pairs[:-1]):
if pair[1] != pairs[idx+1][0]:
print pair
....:
(6145071619554493444L, 6157494985551179586L)
(6156600834600561912L, 6168130049646630380L)
(6157494985551179586L, 6169666159242871350L)
(9188784391716568996L, 9200313606762637464L)
(6169666159242871350L, 9211842821808705932L)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment