I have a bunch of numpy arrays that can differ in shape:
[[1, 1, 1, 1, 1],
[1, 1, 1, 1, 1],
[1, 1, 1, 1, 1],
[1, 1, 1, 1, 1]]
I need to select and store the indices into a variable so that I can change the array into:
[[1, 1, 1, 1, 1],
[1, 1, 1, 1, 0],
[1, 1, 1, 1, 0],
[0, 0, 0, 0, 0]]
I can grab the vertical indices:
idx = np.s_[1:4, 3]
But I can't figure out how to add all of the indices from the last row and store them into idx
Update
I want the indices. There are times when I need to reference the values at those indices and there are times when I want to change the values at those indices. Having the indices will allow me the flexibility to do both.