New course! Every coder should learn Generative AI!
Try a free lesson0
You need the ndim property of the ndarray.
It doesn't depend on your Python IDE (Spyder), the command is the same.
This runs also on SoloLearn:
import numpy as np
three_dim = np.zeros((2, 2, 2))
print(three_dim.ndim) # result: 3