pandas / 1.4.0 / reference / api / pandas.multiindex.levshape.html /

pandas.MultiIndex.levshape

property MultiIndex. levshape

A tuple with the length of each level.

Examples

>>> mi = pd.MultiIndex.from_arrays([['a'], ['b'], ['c']])
>>> mi
MultiIndex([('a', 'b', 'c')],
           )
>>> mi.levshape
(1, 1, 1)

© 2008–2022, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
Licensed under the 3-clause BSD License.
https://pandas.pydata.org/pandas-docs/version/1.4.0/reference/api/pandas.MultiIndex.levshape.html