cudf.Index.take#

Index.take(indices, axis=0, allow_fill=True, fill_value=None)#

Return a new index containing the rows specified by indices

Parameters
indicesarray-like

Array of ints indicating which positions to take.

axisint

The axis over which to select values, always 0.

allow_fillUnsupported
fill_valueUnsupported
Returns
outIndex

New object with desired subset of rows.

Examples

>>> idx = cudf.Index(['a', 'b', 'c', 'd', 'e'])
>>> idx.take([2, 0, 4, 3])
StringIndex(['c' 'a' 'e' 'd'], dtype='object')