pandas.MultiIndex.nlevels — pandas 2.2.3 documentation (original) (raw)

property MultiIndex.nlevels[source]#

Integer number of levels in this MultiIndex.

Examples

mi = pd.MultiIndex.from_arrays([['a'], ['b'], ['c']]) mi MultiIndex([('a', 'b', 'c')], ) mi.nlevels 3