Advertisement
Guest User

andrej-voli-sladoled.py

a guest
Nov 20th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.20 KB | None | 0 0
  1. import numpy as np
  2.  
  3. a = np.zeros((3, 3))
  4. print(a)
  5.  
  6. # row i col indexi
  7. ri, ci = np.diag_indices_from(a)
  8. # na row i col indexe ubacimo odgovarujuce elemente tim redom
  9. a[ri, ci] = (1, 2, 3)
  10. print(a)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement