Write a program to create three different Series objects from the three columns of a DataFrame df.

preview_player
Показать описание
Q. Write a program to create three different Series objects from the three columns of a DataFrame df.

Website Link :-

Answer =

import pandas as pd

d = {"col1":[1,4,3],"\
col2":[6,7,8],'\
col3':[9,0,1]}

df = pd.DataFrame(d)

print(s)
print()
print(s1)
print()
print(s2)

Output :-

0 1
1 4
2 3
Name: col1, dtype: int64

0 6
1 7
2 8
Name: col2, dtype: int64

0 9
1 0
2 1
Name: col3, dtype: int64
Рекомендации по теме