Given a numpy array, a range, and a value, how can I fill the array with the value inside the range?
Is there a way that is faster than filling it in manually with a loop one by one?
Edit:
myArray = np.zeros(10)
What I want: [0, 0, 0, 0, 1, 1, 1, 0, 0, 0]
array[range]=valueif i understand you correctly. Otherwise post what you have and what you expect