Index.
to_series
Create a Series with both index and values equal to the index keys.
Useful with map for returning an indexer based on an index.
index (Index, optional) – Index of resulting Series. If None, defaults to original index.
name (str, optional) – Dame of resulting Series. If None, defaults to name of original index.
The dtype will be based on the type of the Index values.
Series