Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
0
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
13th Feb 2020, 10:02 AM
Tibor Santa
Tibor Santa - avatar