raphael_kimmig
searching Neon…
- 1.▲
- 2.▲
- 3.▲
- 4.▲
- 5.▲
- 6.▲
4 ms·
- 1.▲
- 2.▲
- 3.▲
- 4.▲
- 5.▲
- 6.▲
- 7.▲
- 8.▲
- 9.▲
- 10.▲
- 11.▲
- 12.▲
- 13.▲
- 14.▲
- 15.▲
- 16.▲
- 17.▲
- 18.▲
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 - 19.▲
- 20.▲
- 21.▲