is it possible to get values from numpy array based on list of indexes like i.e 1 and 3? Then, I want to put another values instead of them.
Here is example:
import numpy as np
array = np.array([0, 1, 2, 8, 4, 9, 1, 2])
idx = [3, 5]
So I want to replace X[3] = 8 and X[5] = 9 with another values but I do not want to this in a loop because I could have large array. Is it a way or maybe a function to do operations like this but not in a loop?