SciPy

numpy.nditer.shape

attribute

nditer.shape