cudf.MultiIndex.levels#

property MultiIndex.levels#

Returns list of levels in the MultiIndex

Returns
List of Series objects

Examples

>>> import cudf
>>> df = cudf.DataFrame({'a':[1, 2, 3], 'b':[10, 11, 12]})
>>> cudf.MultiIndex.from_frame(df)
MultiIndex([(1, 10),
            (2, 11),
            (3, 12)],
        names=['a', 'b'])
>>> midx = cudf.MultiIndex.from_frame(df)
>>> midx
MultiIndex([(1, 10),
            (2, 11),
            (3, 12)],
        names=['a', 'b'])
>>> midx.levels
[0    1
1    2
2    3
dtype: int64, 0    10
1    11
2    12
dtype: int64]