I'd like to get a nice neat list comprehension for this code or something similar!
extra_indices = []
for i in range(len(indices)):
index = indices[i]
extra_indices.extend([index, index + 1, index +2])
Thanks!
Edit* The indices are a list of integers. A list of indexes of another array.
For example if indices is [1, 52, 150] then the goal (here, this is the second time I've wanted two separate actions on continuously indexed outputs in a list comprehension)
Then extra_indices would be [1, 2, 3, 52, 53, 54, 150, 151, 152]