Create a Series in Pandas

  • Post category:Pandas

In this Pandas tutorial, you will learn how to create a series in Pandas Python. You can make a series in Pandas with the following code.

# Import Pandas library
import pandas as pd

# create a series
var = pd.Series([12, 14, 16, 18, 20])

# Display the series
print(var)

Output:

0    12
1    14
2    16
3    18
4    20
dtype: int64

Free resources to learn advanced skills: AiHints and CodeAllow