Created
March 13, 2012 02:55
-
-
Save mutaku/2026291 to your computer and use it in GitHub Desktop.
iters of iters of iters of lists of lists of lists
This file contains hidden or 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
x = [[[1, 2, 3, 4], [9, 8, 7, 6]], [[10, 20, 30, 40], [90, 80, 70, 60]]] | |
from itertools import chain | |
[[y[i] for y in list(chain.from_iterable(x))] for i in range(0,len(x[0][0]))] |
Author
mutaku
commented
Mar 13, 2012
# catch NoneType and only if less than 200
from itertools import chain
[[y[i] for y in list(chain.from_iterable(x)) if y[i] and y[i] < 200] for i in range(0,len(x[0][0]))]
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment