Informatics Practices
Write a program to create a Series object from an ndarray that stores characters from 'a' to 'g'.
Python Pandas
4 Likes
Answer
import pandas as pd
import numpy as np
data = np.array(['a', 'b', 'c', 'd', 'e', 'f', 'g'])
S = pd.Series(data)
print(S)Output
0 a
1 b
2 c
3 d
4 e
5 f
6 g
dtype: object
Answered By
3 Likes
Related Questions
Write a program to create three different Series objects from the three columns of a DataFrame df.
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 that stores the table of number 5.
Write a program to create a Dataframe that stores two columns, which store the Series objects of the previous two questions (12 and 13).