numpy.generic.ndim

attribute

generic.ndim

number of array dimensions