how can I change the values of the diagonal of a matrix in numpy?
I checked Numpy modify ndarray diagonal, but the function there is not implemented in numpy v 1.3.0
def replaceDiagonal(matrix, replacementList): for i in range(len(replacementList)): matrix[i][i] = replacementList[i]
Where size is n in an n x n matrix.