In order to test a wide range of parameters on a single value output, I am creating a multi-dimensional array to store the values. However, in order to update the values accordingly, I need to calculate the positions to be updated. In order to make this fast, I would like to slice a N dimensional array with an N-1 Dimensional Array. For example, if I had a 2D Array: ''' arr = 1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5 '''
and a slicing array: ''' slicer = [2, 3, 1, 3, 5] ''' would it be possible to do something like this:
arr[:slicer] =
1 2 N N N
1 2 3 N N
1 N N N N
1 2 3 N N
1 2 3 4 5
Where N is Nan or Nul or empty.
Is this possible? If not, what is the best/fastest way to achieve the same result?
To be clear, in my ideal world I would be able to do something like this:
arr[:slicer] = arr[:slicer] * update