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
Write a program to create three different Series objects from the three rows of a DataFrame df.
Write a program to create a Series object from an ndarray that stores characters from 'a' to 'g'.
Write a program to create a Dataframe that stores two columns, which store the Series objects of the previous two questions (12 and 13).
Write a program to create a Dataframe storing salesmen details (name, zone, sales) of five salesmen.