Professional Documents
Culture Documents
INFORMATICS PRACTICES(065)
CLASS XII IP (2022-2023)
Topic : Series and Dataframes (Lab Work Sheet-1)
1. Write a Python program to create the following Series A:
P 30
Q 22
R 13
S 15
T 14
Include code to perform the following operations in it:
(a) Display the indices of A.
(b) Display the power of the values of A raised to 2.
(c) Display the first 3 rows and last 2 rows of A.
(d) Display the even elements of A and elements less than 25.
2. Create a Series with Values: Grades= [9.5,6.7,8.8,9.1,7.5,6.7,5.5,4.7,5.4.6.8].Indices:
Names=Amit, Sneha, Manya, Pari, Lavanya, Priya, Arya, Ronald, Tim, Sam.
1) List only the students who got grade > 7.5
2) List the students who got < 5
3) Give a grace mark 5 to all.
4) Convert the grades to 50s (All given grades are out of 10)
3. Write a Pandas menu-based program to 1)add 2)subtract 4) multiple and 5)divide
two Pandas Series:
P1= [2,4, 6, 8,10]
Q2= [3, 5, 7,9,11
4.
5. Create two Dataframes Df1 and Df2 and perform the operations specified:-
Df1 Df2
M1 M2 M1 M2
01 73 69 01 39 75
02 65 52 02 82 59
03 98 85 03 77 74
1) Add the corresponding Columns
2) Multiply the 2 dataframes
3) Modify labels M1 and M2 with Subject names IP and BST in Df1 and Df2
4) Delete 03 and add a new row with index 07 in Df1 with marks 100 , 100