Lowest price ever! Learn Generative AI for 48% less!
Get my discount0
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