Python | Pandas Index.to_series() Last Updated : 24 Dec, 2018 Summarize Comments Improve Suggest changes Share Like Article Like Report Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas Index.to_series() function create a Series with both index and values equal to the index keys useful with map for returning an indexer based on an index. It is possible to set a new index label for the newly created Series by passing the list of new index labels. Syntax: Index.to_series(index=None, name=None) Parameters : index : index of resulting Series. If None, defaults to original index name : name of resulting Series. If None, defaults to name of original index Returns : Series : dtype will be based on the type of the Index values. Example #1: Use Index.to_series() function to convert the index into a Series. Python3 # importing pandas as pd import pandas as pd # Creating the index idx = pd.Index(['Harry', 'Mike', 'Arther', 'Nick'], name ='Student') # Print the Index print(idx) Output : Let's convert the index into a Series. Python3 # convert the index into a series idx.to_series() Output : The function has converted the index into a series. By default, the function has created the index of the series using the values of the original Index. Example #2: Use Index.to_series() function to convert the index into a series such that the series created uses new index value. Python3 # importing pandas as pd import pandas as pd # Creating the index idx = pd.Index(['Alice', 'Bob', 'Rachel', 'Tyler', 'Louis'], name ='Winners') # Print the Index print(idx) Output : Let's convert the index into a series. Python3 # convert the index into a series idx.to_series(index =['Student 1', 'Student 2', 'Student 3', 'Student 4', 'Student 5']) Output : The function has converted the index into a series. We have passed a list of index labels to be used for the newly created Series. Comment More infoAdvertise with us Next Article Python | Pandas DatetimeIndex.to_series() S Shubham__Ranjan Follow Improve Article Tags : Technical Scripter Python Python-pandas Python pandas-indexing Practice Tags : python Similar Reads Python | Pandas Series.to_latex() Pandas series is a One-dimensional ndarray with axis labels. The labels need not be unique but must be a hashable type. The object supports both integer- and label-based indexing and provides a host of methods for performing operations involving the index.Pandas Series.to_latex() function render an 3 min read Python | Pandas Series.to_dense() Pandas series is a One-dimensional ndarray with axis labels. The labels need not be unique but must be a hashable type. The object supports both integer- and label-based indexing and provides a host of methods for performing operations involving the index. Pandas Series.to_dense() function return de 3 min read Python | Pandas DatetimeIndex.to_series() Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas DatetimeIndex.to_series() function create a Series with both index and values e 2 min read Python | Pandas Series.to_dict() Pandas series is a One-dimensional ndarray with axis labels. The labels need not be unique but must be a hashable type. The object supports both integer- and label-based indexing and provides a host of methods for performing operations involving the index. Pandas Series.to_dict() function is used to 3 min read Python | Pandas Series.ix Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas series is a One-dimensional ndarray with axis labels. The labels need not be un 2 min read Python | Pandas Series.str.encode() Series.str can be used to access the values of the series as strings and apply several methods to it. Pandas Series.str.encode() function is used to encode character string in the Series/Index using indicated encoding. Equivalent to str.encode(). Syntax: Series.str.encode(encoding, errors='strict') 2 min read Like