SciPy

numpy.record.ndim

attribute

record.ndim

number of array dimensions