Learning machine learning? Try my machine learning flashcards or Machine Learning with Python Cookbook.

# Find The Rank Of A Matrix

## Preliminaries

```
# Load library
import numpy as np
```

## Create Matrix

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

## Find Rank Of Matrix

```
# Return matrix rank
np.linalg.matrix_rank(matrix)
```

```
2
```

#### Find an error or bug?

Everything on this site is available on GitHub. Head to and submit a suggested change. Include the tutorial's URL in the issue.