cudf.MultiIndex.codes#

property MultiIndex.codes#

Returns the codes of the underlying MultiIndex.

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.codes
   a  b
0  0  0
1  1  1
2  2  2