Python Practice › Pandas Programs › Program 1
Create a Series
Write a pandas program to create and display a one-dimensional Series.
Input
[15, 43, 88, 23]
Output
0 15 1 43 2 88 3 23 dtype: int64
Approach
pd.Series(list); pandas adds an index 0, 1, 2, …
Solution
import pandas as pds = pd.Series([15, 43, 88, 23])print(s)Output
0 15 1 43 2 88 3 23 dtype: int64
Learn the concept
New to this topic? Read the lesson, then come back.