title: How to remove multiple values from an array at once
body: <p>Can someone provide me with a better (simpler, more readable, more Pythonic, more efficient, etc.) way to remove multiple values from an array than what follows:</p>
  
  <pre><code>import numpy as np
  
  # The array.
  x = np.linspace(0, 360, 37)
  
  # The values to be removed.
  a = 0
  b = 180
  c = 360
  
  new_array = np.delete(x, np.where(np.logical_or(np.logical_or(x == a,
                                                                x == b),
                                                  x == c)))
  </code></pre>
  
  <p>A good answer to this question would produce the same result as the above code (i.e., <code>new_array</code>), but might do a better job dealing with equality between floats than the above code does.</p>
  
  <h1>BONUS</h1>
  
  <p>Can someone explain to me why this produces the wrong result?</p>
  
  <pre><code>In [5]: np.delete(x, x == a)
  /usr/lib/python2.7/dist-packages/numpy/lib/function_base.py:3254: FutureWarning: in the future insert will treat boolean arrays and array-likes as boolean index instead of casting it to integer
    "of casting it to integer", FutureWarning)
  Out[5]: 
  array([  20.,   30.,   40.,   50.,   60.,   70.,   80.,   90.,  100.,
          110.,  120.,  130.,  140.,  150.,  160.,  170.,  180.,  190.,
          200.,  210.,  220.,  230.,  240.,  250.,  260.,  270.,  280.,
          290.,  300.,  310.,  320.,  330.,  340.,  350.,  360.])
  </code></pre>
  
  <p>The values 0 and 10 have both been removed, rather than just 0 (<code>a</code>).</p>
  
  <p>Note, <code>x == a</code> is as expected (so the problem is inside <code>np.delete</code>):</p>
  
  <pre><code>In [6]: x == a
  Out[6]: 
  array([ True, False, False, False, False, False, False, False, False,
         False, False, False, False, False, False, False, False, False,
         False, False, False, False, False, False, False, False, False,
         False, False, False, False, False, False, False, False, False, False], dtype=bool)
  </code></pre>
  
  <p>Note as well that <code>np.delete(x, np.where(x == a))</code> produces the correct result.  Thus, it appears to me that <code>np.delete</code> cannot handle Boolean indices.</p>