How to get indices of non-diagonal elements of a numpy array? : <p>How to get indices of non-diagonal elements of a numpy array?</p>

<pre><code>a = np.array([[7412, 33, 2],
              [2, 7304, 83],
              [3, 101, 7237]])
</code></pre>

<p>I tried as follows:</p>

<pre><code>diag_indices = np.diag_indices_from(a)
print diag_indices
(array([0, 1, 2], dtype=int64), array([0, 1, 2], dtype=int64))
</code></pre>

<p>After that, no idea...
The expected result should be:</p>

<pre><code>result = [[False, True, True],
        [True, False, True],
         [True, True, False]]
</code></pre>
