title: How do I replace values in numpy array?
body: <p>I want to replace elements in a np.array, for instance:</p>
  
  <pre><code>arr = np.array([4,5,6,7,3])
  </code></pre>
  
  <p>I want to replace every element which meets my condition with a given value, for example 3&lt;=x&lt;=5. And replace it with a random number such as randint(90, 99).</p>
  
  <p>Therefore, my expected output is:</p>
  
  <pre><code>[91 94  6  7 92]
  </code></pre>
  
  <p>I tried something like this:</p>
  
  <pre><code>out = np.where(arr&gt;4, randint(90, 99), arr)
  </code></pre>
  
  <p>But I have 2 probelms: <br>
  1) I can't specity an interval<br>
  2) I can't get 3 random numbers - but only one</p>