3 ms·
You can also do zip(arr[::3], arr[1::3], arr[2::3]) which is nearly as fast but doesn't work with iterators. If you want to use iterators you could also d
by raphael_kimmig 13y ago
You can also do
zip(arr[::3], arr[1::3], arr[2::3])
which is nearly as fast but doesn't work with iterators.
If you want to use iterators you could also do
zip(islice(arr, 0, None, 3), islice(arr, 1, None, 3), islice(arr, 2, None, 3))
which is a tad slower.