cudf.MultiIndex#

class cudf.MultiIndex(levels=None, codes=None, sortorder=None, names=None, dtype=None, copy=False, name=None, **kwargs)#

A multi-level or hierarchical index.

Provides N-Dimensional indexing into Series and DataFrame objects.

Parameters
levelssequence of arrays

The unique labels for each level.

codes: sequence of arrays

Integers for each level designating which label at each location.

sortorderoptional int

Not yet supported

names: optional sequence of objects

Names for each of the index levels.

copybool, default False

Copy the levels and codes.

verify_integritybool, default True

Check that the levels/codes are consistent and valid. Not yet supported

Returns
MultiIndex

Examples

>>> import cudf
>>> cudf.MultiIndex(
... levels=[[1, 2], ['blue', 'red']], codes=[[0, 0, 1, 1], [1, 0, 1, 0]])
MultiIndex([(1,  'red'),
            (1, 'blue'),
            (2,  'red'),
            (2, 'blue')],
           )