w3resource logo

:

Python Exercises

Python Pandas: Create and display a one-dimensional array-like object containing an array of data using Pandas module

Python Pandas: Date Series Exercise-1 with Solution

Write a Python program to create and display a one-dimensional array-like object containing an array of data using Pandas module.

Sample Solution :-

Python Code :

import pandas as pd
ds = pd.Series([2, 4, 6, 8, 10])
print(ds)

Sample Output:

0     2                                                                
1     4                                                                
2     6                                                                
3     8                                                                
4    10                                                                
dtype: int64

Python Code Editor:

Improve this sample solution and post your code through Disqus