Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n_comp = 10
- s1 = np.diag(s)
- print s1[0].shape
- print s1[1].shape
- for i in range(s1[0].shape[0]):
- for j in range(s1[1].shape[0]):
- if j >= n_comp:
- s1[i][j] = 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement