SciPy

numpy.record.ndim

record.ndim

number of array dimensions