pandas.MultiIndex.nlevels#
- property MultiIndex.nlevels[source]#
Integer number of levels in this MultiIndex.
See also
MultiIndex.levelsGet the levels of the MultiIndex.
MultiIndex.codesGet the codes of the MultiIndex.
MultiIndex.from_arraysConvert arrays to MultiIndex.
MultiIndex.from_tuplesConvert list of tuples to MultiIndex.
Examples
>>> mi = pd.MultiIndex.from_arrays([["a"], ["b"], ["c"]]) >>> mi MultiIndex([('a', 'b', 'c')], ) >>> mi.nlevels 3