title: Constrain values of an array
body: <p>I'm trying to constrain the values of a numpy array so that no values lie between -0.5 and 0.5. So if I had an array shaped (6,2) with values like this:</p>
  
  <pre><code>array([[  0.49873803,  -1.66316398],
         [ -0.36091764,   2.0635736 ],
         [ -1.09922111,  -2.49380792],
         [  0.92724579,  -5.19540319],
         [  1.49726584,  -0.22718924],
         [ 60.        ,  60.        ]])
  </code></pre>
  
  <p>How can I get numpy to change the values that are from -0.5 -> 0.0 to be -0.5, and 
  from 0.5 -> 0.0 to be 0.5 so that the example array would be:</p>
  
  <pre><code>array([[  0.5,  -1.66316398],
         [ -0.5,   2.0635736 ],
         [ -1.09922111,  -2.49380792],
         [  0.92724579,  -5.19540319],
         [  1.49726584,  -0.5],
         [ 60.        ,  60.        ]])
  </code></pre>
  
  <p>I tried using np.clip but that didnt work, or I couldn't figure it out, so here I am!</p>