cudf.Index.to_series#

Index.to_series(index: Index | None = None, name: Hashable | None = None) Series[source]#

Create a Series with both index and values equal to the index keys. Useful with map for returning an indexer based on an index.

Parameters:
indexIndex, optional

Index of resulting Series. If None, defaults to original index.

nameHashable, optional

Name of resulting Series. If None, defaults to name of original index.

Returns:
Series

The dtype will be based on the type of the Index values.