cudf.Index.to_pandas#

Index.to_pandas(*, nullable: bool = False)#

Convert to a Pandas Index.

Parameters:
nullablebool, Default False

If nullable is True, the resulting index will have a corresponding nullable Pandas dtype. If there is no corresponding nullable Pandas dtype present, the resulting dtype will be a regular pandas dtype. If nullable is False, the resulting index will either convert null values to np.nan or None depending on the dtype.

Examples

>>> import cudf
>>> idx = cudf.Index([-3, 10, 15, 20])
>>> idx
Int64Index([-3, 10, 15, 20], dtype='int64')
>>> idx.to_pandas()
Int64Index([-3, 10, 15, 20], dtype='int64')
>>> type(idx.to_pandas())
<class 'pandas.core.indexes.numeric.Int64Index'>
>>> type(idx)
<class 'cudf.core.index.Int64Index'>