> I'm just wondering if there is a way that i can increment all the values > along a diagonal?
Assume you want to change mat. # min() only necessary for non-square matrices index = arange(min(mat.shape[0], mat.shape[1])) # add 1 to each diagonal element matrix[index, index] += 1 # add some other stuff matrix[index, index] += some_array_shaped_like_index HTH, Johannes ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Numpy-discussion mailing list Numpy-discussion@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/numpy-discussion