If I have an array a = [1,2,3,4,5,6,7,8,9,10] and I want a subset of this array – the 1st, 5th and 7th elements. Is it possible to extract these from this array in a simple way. I was thinking something like:
a[0,4,6] = [1,5,7]
but that doesn’t work.
Also is there a way to return all indices except those specified? For example, something like
a[-0,-4,-6] = [2,3,4,6,8,9,10]
Here’s one way: