7 lines
260 B
Python
7 lines
260 B
Python
import numpy as np
|
|
# Creating a 2x2 identity matrix
|
|
identity_matrix = np.eye(2)
|
|
print(f'2x2 identity matrix:\n{identity_matrix}')
|
|
# Creating a 4x3 matrix with np.eye()
|
|
rectangular_matrix = np.eye(4, 3, dtype=np.int8)
|
|
print(f'4x3 matrix:\n{rectangular_matrix}') |