arr.transpose(1,0,2,3,4,5)
or np.swapaxes(arr,0,1)
put the 150 dimension first. Then you can use list
.
Or you could use a list comprehension
[a[:,i] for i in range(150)]
The transpose is somewhat better
In [28]: timeit list(arr.transpose(1,0,2,3,4,5))
47.7 μs ± 47.1 ns per loop (mean ± std. dev. of 7 runs, 10000 loops each)
In [29]: timeit [arr[:,i] for i in range(150)]
88.7 μs ± 22.2 ns per loop (mean ± std. dev. of 7 runs, 10000 loops each)
In [32]: timeit list(np.swapaxes(arr,0,1))
49.2 μs ± 51.1 ns per loop (mean ± std. dev. of 7 runs, 10000 loops each)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…