Professional Documents
Culture Documents
12 Grade Worksheet2
12 Grade Worksheet2
12 Grade Worksheet2
(Sri Lakshmi Saraswathi Educational Society, Affiliated to Central Board of Secondary Education, New Delhi)
1. What is a DataFrame?
2. Write a program in python to create series of given tuple : A = (11, 22, 33, 44, 55)
3. Write a program in Python to create the pandas series of all the characters in the name accepted from
user.
4. Name any two attributes of Series in Python.
5. Write a program to create a series from dictionary that stores classes (6,7,8,9,10) as keys and number of
students as values.
6. Write a program in Python to create a Series in Python from the given dictionary. D = {“Jan” : 31,
“Feb” : 28, “Mar” : 31}
7. Write the output of the following :
import pandas as pd
S1 = pd.Series(12, index = [4, 6, 8])
print(S1)
import pandas as pd
S1 = pd.Series([31, 28, 31, 30, 31], index = ["Jan", "Feb", "Mar", "Apr", "May"])
print("-----------")
print(S1[1:3])
print("-----------")
print(S1[:5])
print("-----------")
print(S1[3:3])
print("-----------")
print(S1["Jan":"May"])