title: In NumPy, how to explain the return of ndarray[True]?
body: <p>In NumPy, I know that we can index an <code>ndarray</code> by boolean values in the following way in a Python interpreter:</p>
  
  <pre><code>&gt;&gt;&gt; import numpy as np
  &gt;&gt;&gt; b = np.arange(1, 6)
  &gt;&gt;&gt; print(b)
  [1 2 3 4 5]
  &gt;&gt;&gt; bi = np.array([True, False, True, False, True])
  &gt;&gt;&gt; print(b[bi])
  [1 3 5]
  </code></pre>
  
  <p>Then I tried <code>b[True]</code>, I couldn't understand what its return means. Could someone explain it to me? Thanks.</p>
  
  <pre><code>&gt;&gt;&gt; print(b)
  [1 2 3 4 5]
  &gt;&gt;&gt; b[True]
  array([[1, 2, 3, 4, 5]])
  &gt;&gt;&gt; b[True]
  array([[1, 2, 3, 4, 5]])
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>With this feature, can I use it to get a vector from a rank one array? Just like the following:</p>
  
  <pre><code>&gt;&gt;&gt; b = np.arange(1, 6)
  &gt;&gt;&gt; print(b)
  [1 2 3 4 5]
  &gt;&gt;&gt; row_vec = b[True]
  &gt;&gt;&gt; print(row_vec)
  [[1 2 3 4 5]]
  &gt;&gt;&gt; col_vec = b[True].T
  &gt;&gt;&gt; print(col_vec)
  [[1]
   [2]
   [3]
   [4]
   [5]]
  </code></pre>
  
  <p>I have to say, it is hard to understand, but is it a better choice than <code>reshape</code> method to do that?</p>