identity matrix with numpy code example
Example 1: numpy identity matrix
>>> np.identity(3)
array([[1., 0., 0.],
[0., 1., 0.],
[0., 0., 1.]])
Example 2: identity matrix in python
#Change the value 3 to the size of the identity matrix
>>>np.identity(3)
array([[1., 0., 0.],
[0., 1., 0.],
[0., 0., 1.]])