SciPy

numpy.nditer.shape

nditer.shape