numpy.nditer.ndim

attribute

nditer.ndim