Table of Contents

				
					import numpy as np
				
			

Example 1 Create a 3x3 identity matrix

				
					I = np.identity(3)
				
			
				
					print("3x3 Identity Matrix:")
print(I)
				
			
also can use np.eye
				
					I2 = np.eye(3)
				
			
				
					print("3x3 Identity Matrix:")
print(I2)
				
			

Example 2 Matrix Multiplication

				
					Define a random matrix A
A = np.array([[2, 6], [3, 3]])
				
			
				
					Identity matrix of appropriate size
I = np.identity(2)
				
			
				
					# Multiplication with the identity matrix
result = np.dot(A, I)
				
			
				
					print("Matrix A:")
print(A)
				
			
				
					print("A multiplied by Identity Matrix:")
print(result)
				
			
				
					Multiplication with the identity matrix
result2 = np.dot(I, A)
				
			
				
					print("A multiplied by Identity Matrix:")
print(result2)
				
			

Example 3 Determinant of the Identity Matrix

				
					det_I = np.linalg.det(I)
				
			
				
					print("Determinant of Identity Matrix:")
print(det_I)
				
			

Example 4 Identity Matrix is Its Own Inverse

				
					inverse_I = np.linalg.inv(I)
				
			
				
					print("Inverse of Identity Matrix:")
print(inverse_I)
				
			

Example 5 Eigenvalues of the Identity Matrix

				
					eigenvalues, _ = np.linalg.eig(I)
print("Eigenvalues of Identity Matrix:")
print(eigenvalues)
				
			

Free Community

Join 1,000+ AI Automation Builders

Weekly tutorials, live calls & direct access to Ryan & Matt.

Join Free →

Keep Learning

Python Reduced Row Echelon Form

https://youtu.be/12hpWB3cmzg From REF to RREF

Python Augmented Matrix

https://youtu.be/wDrAPOPUIMY Example 1 Example 2 row operations Multiply the first row by 3 add: 2nd row to the first subtract 2nd row...

Python Multiply Matrices

https://youtu.be/RzePfrH0XNM

Inverse Matrix

https://youtu.be/wfHaKrmMbFk 2x2 example 3x3 example properties A^-1 * A = A * A^-1 = I (AB)^−1=B^−1A^−1 (A^T)^−1=(A^−1)^T (kA)^−1=(1/k)(​A^−1) (A^−1)^−1=A