Python | Pandas Series.from_array() Last Updated : 13 Feb, 2019 Comments Improve Suggest changes Like Article Like Report 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.from_array() function construct a Series object from an array. We can also set the name and index of the series at the time of creation. Syntax: Series.from_array(arr, index=None, name=None, dtype=None, copy=False, fastpath=False) Parameter : arr : array to be used for construction of series index : set the index of the series name : Set the name of the series Returns : series Example #1: Use Series.from_array() function to construct a series object from an array. Python3 # importing pandas as pd import pandas as pd # Creating an array array = ['New York', 'Chicago', 'Toronto', 'Lisbon', 'Rio'] # Create the Index index_ = ['City 1', 'City 2', 'City 3', 'City 4', 'City 5'] # Creating the series sr = pd.Series.from_array(arr = array, index = index_) # Print the series print(sr) Output : As we can see in the output, the Series.from_array() function has successfully constructed a series object from an array. Example #2: Use Series.from_array() function to construct a series object from an array. Also set the name of the series Python3 # importing pandas as pd import pandas as pd # Creating an array array = [11, 21, 8, 18, 65, 84, 32, 10, 5, 24, 32] # Create the Index index_ = pd.date_range('2010-10-09', periods = 11, freq ='M') # Creating the series # set the index # set the name sr = pd.Series.from_array(arr = array, index = index_, name = 'My_series') # Print the series print(sr) Output : As we can see in the output, the Series.from_array() function has successfully constructed a series object from an array. We have also set the name of the series. Comment More infoAdvertise with us Next Article Python | Pandas Series.from_array() S Shubham__Ranjan Follow Improve Article Tags : Python Pandas Python-pandas Python pandas-series-methods AI-ML-DS With Python +1 More Practice Tags : python Similar Reads Python | Pandas Series.from_csv() 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.from_csv() function is used t 2 min read Python | Pandas Series.data 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.at 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.at attribute enables us to access a single value for a row/column label 2 min read Python | Pandas Series.apply() 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.apply() function invoke the p 3 min read Python | Pandas Series.to_frame() 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_frame() function is used t 3 min read Python | Pandas Series.iat 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.loc 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.as_matrix() 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.as_matrix() function is used 3 min read Python | Pandas Series.item() 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.item() function return the fi 2 min read Python | Pandas Series.as_blocks() 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.as_blocks() function is used 3 min read Like