Hello every body. I am new to python.<br>
        How to remove any row or column of a numpy matrix whose sum is 3.<br>
        To obtain and save new matrix P with (sum(anyrow)!=3 and sum(anycolumn)!=3 elements.<br>
<br>
I tried like this:<br>
<br>
P = M[np.logical_not( (M[n,:].sum()==3) & (M[:,n].sum()==3))]<br>
or <br>
P = M[np.logical_not( (np.sum(M[n,:])==3) & (np.sum(M[:,n])==3))]<br>
<br>
<br>
M is the nxn numpy matrix. <br>
But I got indexerror. So can anyone correct this or any other elegant way of doing this?<br>
<br>
        Thanks for your help