Articles → Numpy → Create An Identity Matrix In Numpy
Create An Identity Matrix In Numpy
What Is An Identity Matrix?
Click to Enlarge
Syntax
Example
import numpy as np
print("====2 ROWS and 2 COLUMNS======")
print(np.eye(2))
print("====3 ROWS and 3 COLUMNS======")
print(np.eye(3))
Output
Click to Enlarge