#Import the NumPy library
import numpy as np

# Creating a matrix
A = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])

# Computing the QR decomposition of the matrix
Q, R = np.linalg.qr(A)

# Computing the rank of the matrix
rank = np.sum(np.abs(np.diag(R)) > 1e-10)

print(rank)  # Output: 2