Ans. In order to create the identity matrix with numpy, we will use the identity() function. Numpy is imported as np
np.identity(3)
We will obtain the output as –
array([[1., 0., 0.],
[0., 1., 0.],
[0., 0., 1.]])
Ans. In order to create the identity matrix with numpy, we will use the identity() function. Numpy is imported as np
np.identity(3)
We will obtain the output as –
array([[1., 0., 0.],
[0., 1., 0.],
[0., 0., 1.]])
by
Tags:
Leave a Reply