I have a one dimensional numpy array of shape (99,) which appears like the following:
[1 1 0 2 0 1 2 0 1 2 1 2 0 1 0 0 1 0 0 1 0 2 1 1 2 1 0 1 2 0 0 0 0 0 0 1 2
1 1 0 1 1 2 1 1 0 1 0 1 2 0 0 2 0 1 1 2 0 2 0 2 0 2 0 0 2 1 0 0 0 1 0 2 1
1 0 0 1 1 1 0 1 1 1 2 2 0 0 2 0 1 1 1 2 2 2 0 2 1]
I would like to use the above array to select values from a multidimensional array of shape (99,3). Here are the first 5 rows of this array:
array([[ 257.985, 332.58 , 2524.92 ],
[ 254.29 , 330.785, 2494.01 ],
[ 253.81 , 335.74 , 2499.5 ],
[ 255.16 , 336.7 , 2479.9 ],
[ 249.98 , 329.48 , 2451.32 ]])
I requesting coding help with this part. I'm looking to use the first array as an index to select values from the second multidim array shown above, creating a new array from this. For example, the first 5 values of this new array would be:
[332.58, 330.785, 253.81, 2479.9, 249.98, ...]