title: Index multiple, non-adjacent ranges in numpy
body: <p>I'd like to select multiple, non-adjacent ranges from a 1d numpy array (or vector).</p>
  
  <p>Suppose:</p>
  
  <pre><code>&gt;&gt;&gt; idx = np.random.randint(100, size=10)
  array([82,  9, 11, 94, 31, 87, 43, 77, 49, 50])
  </code></pre>
  
  <p>This works, of course:</p>
  
  <pre><code>&gt;&gt;&gt; idx[0:3]
  array([82,  9, 11])
  </code></pre>
  
  <p>And this works to fetch via individual indices:</p>
  
  <pre><code>&gt;&gt;&gt; idx[[0,3,4]]
  array([82, 94, 31])
  </code></pre>
  
  <p>But what if I want to select the ranges <code>0:3</code>, and <code>7:</code>?</p>
  
  <p>I've tried:    </p>
  
  <pre><code>&gt;&gt;&gt; idx[[0:3,7:]]
  SyntaxError: invalid syntax
  </code></pre>
  
  <p>Is there a simple way to do this, or do I need to generate them separately and concatenate?</p>