[Numpy-discussion] How to fix the diagonal values of a matrix

gerardo.berbeglia gberbeglia@gmail....
Tue Mar 16 08:43:41 CDT 2010


How can i take out the diagonal values of a matrix and fix them to zero?

Example:

input: [[2,3,4],[3,4,5],[4,5,6]]

output: [[0,3,4],[3,0,5],[4,5,0]]

Thanks.
-- 
View this message in context: http://old.nabble.com/How-to-fix-the-diagonal-values-of-a-matrix-tp27917991p27917991.html
Sent from the Numpy-discussion mailing list archive at Nabble.com.



More information about the NumPy-Discussion mailing list