title: Replace value in array when greater than x
body: <p>I get a little problem with a simple idea. I have an array of data and I would like to replace each value if the value is greater than X.</p>
  
  <p>To solve that, I wrote a little script as example which give the same idea :</p>
  
  <pre><code>import numpy as np
  
  # Array creation
  
  array = np.array([0.5, 0.6, 0.9825])
  
  print array
  
  # If value &gt; 0.7 replace by 0.
  
  new_array = array[array &gt; 0.7] == 0
  
  print new_array
  </code></pre>
  
  <p>I would like to obtain : </p>
  
  <pre><code>&gt;&gt;&gt; [0.5, 0.6, 0] # 0.9825 is replaced by 0 because &gt; 0.7
  </code></pre>
  
  <p>Thank you if you could me help ;)</p>
  
  <p><strong>EDIT :</strong> </p>
  
  <p>I didn't find How this subject could help me : <a href="https://stackoverflow.com/questions/19666626/replace-all-elements-of-python-numpy-array-that-are-greater-than-some-value">Replace all elements of Python NumPy Array that are greater than some value</a>
  The answer given by @ColonelBeauvel is not noticed in the previous post.</p>