title: Return the indices of unmasked elements that are both zero and not zero
body: <p>How to get the index of all unmasked elements? The following is an example where I'm struggling with. I've got  two equal sized numpy arrays, x and m. Now I want to use array m as a mask on x to extract both values and index of the unmasked values. I think that some code will explain better</p>
  
  <p>numpy array x &amp; m</p>
  
  <pre><code>&gt;&gt;&gt; x = np.array([[3,5,9],[6,0,7],[2,3,4]])
  &gt;&gt;&gt; x
  array([[3, 5, 9],
         [6, 0, 7],
         [2, 3, 4]])
  &gt;&gt;&gt; m = np.array([[1,1,2],[2,1,1],[2,1,2]])
  &gt;&gt;&gt; m
  array([[1, 1, 2],
         [2, 1, 1],
         [2, 1, 2]])
  </code></pre>
  
  <p>Now I want to extract the values of x where m is equal to 1</p>
  
  <pre><code>&gt;&gt;&gt; mo = ma.array(m,mask=(m&lt;&gt;1))
  &gt;&gt;&gt; mo
  masked_array(data =
   [[1 1 --]
   [-- 1 1]
   [-- 1 --]],
               mask =
   [[False False  True]
   [ True False False]
   [ True False  True]],
         fill_value = 999999)
  
  &gt;&gt;&gt; xm = ma.masked_array(x,mask=mo.mask, dtype=int)
  &gt;&gt;&gt; xm
  masked_array(data =
   [[3 5 --]
   [-- 0 7]
   [-- 3 --]],
               mask =
   [[False False  True]
   [ True False False]
   [ True False  True]],
         fill_value = 999999)
  </code></pre>
  
  <p>I want to have the index of the values where mask is False. Now I can use the nonzero function from ma library, but my arrays also contains zero values. As can be seen, value <code>[1,1]</code> is missing:</p>
  
  <pre><code>&gt;&gt;&gt; xmindex = np.transpose(ma.MaskedArray.nonzero(xm))
  &gt;&gt;&gt; xmindex
  array([[0, 0],
         [0, 1],
         [1, 2],
         [2, 1]])
  </code></pre>
  
  <p>In short, how to get the index of all unmasked elements and not only the nonzero values?</p>