title: numpy IndexError: too many indices for array when indexing matrix with another
body: <p>I have a matrix a which I create like this:</p>
  
  <pre><code>&gt;&gt;&gt; a = np.matrix("1 2 3; 4 5 6; 7 8 9; 10 11 12")
  </code></pre>
  
  <p>I have a matrix labels which I create like this:</p>
  
  <pre><code>&gt;&gt;&gt; labels = np.matrix("1;0;1;1")
  </code></pre>
  
  <p>This is what the two matricies look like:</p>
  
  <pre><code>&gt;&gt;&gt; a
  matrix([[ 1,  2,  3],
          [ 4,  5,  6],
          [ 7,  8,  9],
          [10, 11, 12]])
  &gt;&gt;&gt; labels
  matrix([[1],
          [0],
          [1],
          [1]])
  </code></pre>
  
  <p>As you can see, when I select all columns, there is no problem</p>
  
  <pre><code>&gt;&gt;&gt; a[labels == 1, :]
  matrix([[ 1,  7, 10]])
  </code></pre>
  
  <p>But when I try to specify a column I get an error</p>
  
  <pre><code>&gt;&gt;&gt; a[labels == 1, 1]
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "/usr/local/lib/python2.7/site-packages/numpy/matrixlib/defmatrix.py", line 305, in     __getitem__
      out = N.ndarray.__getitem__(self, index)
  IndexError: too many indices for array
  &gt;&gt;&gt;   
  </code></pre>
  
  <p>Does anybody know why this is?
  I am aware there are similar questions to this already but none of them explain my problem well enough, neither are the answers helpful to me.</p>