Q. Write a program to create a Series object with 6 random integers and having indexes as: ['p', 'q', 'r', 'n', 't', 'v']
Answer :-
import pandas as pd import numpy as np s = pd. Series (np.random.randint (6), index =['p', 'q', 'r', 'n', 't', 'v']) print(s)
Output :-
p 4
q 4
r 4
n 4
t 4
v 4
dtype: int64
>>>
Post a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )