We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Python
- Numpy
- Eye and Identity
- Discussions
Eye and Identity
Eye and Identity
Sort by
recency
|
304 Discussions
|
Please Login in order to post a comment
import numpy as np
np.set_printoptions(legacy='1.13') n = input() l1 = list(map(int,n.split(' '))) print(np.eye(l1[0],l1[1]))
For Python3 Platform
For Python3
import numpy numpy.set_printoptions(legacy='1.13')
print(numpy.eye(*map(int,input().split())))
import numpy numpy.set_printoptions(legacy='1.13') N, M = map(int, input().strip().split()) print(numpy.eye(N, M))