title: Mask numpy array based on index
body: <p>How do I mask an array based on the actual index values?</p>
  
  <p>That is, if I have a 10 x 10 x 30 matrix and I want to mask the array when the first and second index equal each other.</p>
  
  <p>For example, <code>[1, 1 , :]</code>  should be masked because 1 and 1 equal each other but <code>[1, 2, :]</code> should not because they do not.</p>
  
  <p>I'm only asking this with the third dimension because it resembles my current problem and may complicate things. But my main question is, how to mask arrays based on the value of the indices?</p>