1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] Is there a way to MODIFY the diagonals (not just the centeral diagonal) of a matrix A...

Discussão em 'Python' iniciado por Stack, Setembro 13, 2024.

  1. Stack

    Stack Membro Participativo

    Is there a way to MODIFY the diagonals (not just the centeral diagonal) of a matrix A by using just np.diag()? (so not using np.fill_diag() ). Im not sure how to do a diagonal above the center diagonal for example. I can access the other diagonals but not able to edit them using just np.diag(). Any methods?

    I tried using np.diag() and could read the other diagonals but not change them. Ulitmatly i had to use this super skethcy for loop to change them manually. np.fill_diag() worked for just the main center diagonal but not the others. So help would be nice!

    Continue reading...

Compartilhe esta Página