NumPy

A python library or module used for working with Array. In NumPy, the array object is called ndarray. ndim attribute is used to find out the number of dimensions

import numpy as np
x = np.array([1, 2, 3, 4, 5])
print(x.ndim)