cudf.Index.to_cupy#

Index.to_cupy(dtype: Dtype | None = None, copy: bool = False, na_value=None) cupy.ndarray[source]#

Convert the SingleColumnFrame (e.g., Series) to a CuPy array.

Parameters:
dtypestr or numpy.dtype, optional

The dtype to pass to cupy.asarray().

copybool, default False

Whether to ensure that the returned value is not a view on another array. copy=False does not guarantee a zero-copy conversion, but copy=True guarantees a copy is made.

na_valueAny, default None

The value to use for missing values. If specified, nulls will be filled before converting to a CuPy array. If not specified and nulls are present, falls back to the slower path.

Returns:
cupy.ndarray