Columns are the different fields that contain their particular values when we create a DataFrame. We can perform certain operations on both rows & column values. Pandas Series is just like columns. It is a One-dimensional array that contains a heterogeneous type of data.
There is a certain way to initiate a pandas series, the simplest way is to define an array and pass it inside pandas.Series() method.
pandas.Series() Method
This method of Pandas allows us to create a Series. The pandas.Series() method takes an array as a parameter.
Syntax:
class pandas.Series(
data=None,
index=None,
dtype=None,
name=None,
copy=False,
fastpath=False
)
To work with pandas, we need to import pandas package first, below is the syntax:
import pandas as pd
Let us understand with the help of an example.
Output:

need an explanation for this answer? contact us directly to get an explanation for this answer