title: Conditional index in 2d array in python
body: <p>I have a 2D array, <code>g</code>, like so:</p>
  
  <pre><code>np.array([
  [1 2 3 4], 
  [5 6 7 8], 
  [9 10 11 12]
  ])
  </code></pre>
  
  <p>So <code>g[0]</code> returns the first row, in other words when I give an index of <code>0</code>, I get the first row. When I use an index of 1, I get the second row: </p>
  
  <p><code>g[1] = [5 6 7 8]</code> </p>
  
  <p>and so on.</p>
  
  <p>But I want to return all rows where the index of <code>g</code> is NOT a certain value.
  Eg. I want to return <code>g[x] for all x where x != 1</code>.</p>
  
  <p>I know how to use conditional indexing with 1D arrays, but what about 2D arrays? I'm confused here because I'm not putting conditions on what indices to retrieve according to the values, but I need a condition dependent on the indices themselves.</p>