Informatics Practices

Write a program to create a Series object that stores the table of number 5.

Python Pandas

2 Likes

Answer

import pandas as pd
import numpy as np
arr = np.arange(1, 11)
s = pd.Series(arr * 5)
print(s)

Output

0     5
1    10
2    15
3    20
4    25
5    30
6    35
7    40
8    45
9    50
dtype: int32

Answered By

3 Likes


Related Questions