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
|
302 Discussions
|
Please Login in order to post a comment
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))
numpy.set_printoptions(legacy='1.13')
N, M = map(int, input().split()) eye = numpy.eye(N,M) print(eye)
'*' operator unpacks the two integers so they can be passed as arguements to numpy.eye