"if a=b elif a !=b" doesn't work : <p>I have a table (named table) made of Nbin lists, each one of them containing Nbin elements. Some of those elements are (long) arrays, all the other elements are single 0s.
Then I made this short code:</p>

<pre><code>a=1
b=1
Nbin=3
for a in range(1,Nbin+1):
    for b in range(1,Nbin+1):
        if np.all(table[a][b]!=0) and np.all(a = b):
            s2=11 
            print a,'-',b,s2
        elif np.all(table[a][b]!=0) and np.all(a != b):
            s2=12 
            print a,'-',b,s2
</code></pre>

<p>Basically, the output I am expecting (for Nbin=3) is:</p>

<pre><code>1 - 1 11
1 - 2 12
1 - 3 12
2 - 2 11
2 - 3 12
3 - 3 11
</code></pre>

<p>but what I get is:</p>

<pre><code>1 - 1 11
1 - 2 11
1 - 3 11
2 - 2 11
2 - 3 11
3 - 3 11
</code></pre>

<p>Where did I do wrong?</p>
