• Find  Rank of a Matrix using “matrix_rank” method of “linalg” module of numpy.

  • Rank of a matrix is an important concept and can give us valuable insights about matrix and its behavior.

# Imports
import numpy as np

# Let's create a square matrix (NxN matrix)
mx = np.array([[1,1,1],[0,1,2],[1,5,3]])
mx 
array([[1, 1, 1],
       [0, 1, 2],
       [1, 5, 3]])
# Let's get rank of matrix 
np.linalg.matrix_rank(mx)
3