Unit Test 1 IP Class12 2021
Unit Test 1 IP Class12 2021
Write python code to create a Series from the above List with index as A1, B1, C1, D1, E1
a 1
b 2
c 3
d 4
e 5
f 6
g 7
What will be the output of following statements
print( S8. iloc [1 : 5] )
print( S8. loc[‘b’ : ’e’] )
Q5. Write python code to create a simple line chart for the following data : [4]
A = [ 1, 2, 3, 4, 5 , 6 ]
B = [ 2, 4, 6, 8, 10, 12 ]
Give a proper Title, labels for x-axis and y-axis and set the limits also.
Q6. Write pyhton code to create a Horizontal bar graph/chart for the following data . [4]
Height = [ 5.1, 5.5, 6.0, 5.0, 6.3 ]
Names = [‘Aashi’, ‘Bina’, ‘Chris’, ‘Diya’, ‘Seema’ ]
Add suitable Title and labels.
Q7. The table below shows the Marks of two students for the four unit tests for academic session 2020-2021. [3]
Write Python code to draw a line graph with Test Names on the X-axis and Marks on the Y-axis.
Add legends “Rohit” and “Suman” for the lines.
Tests Marks
Rohit Suman
Unit1 85 97
Unit2 88 99
Unit3 89 90
Unit4 87 92
Q11. A dataframe Result stores the details of students marks in different subjects for a class of 50 students. [2]
The records are arranged in the descending order of total marks obtained by a student.
(i) Write a statement to print the three highest scoring students’ details
(ii) Write a statement to print the four lowest scoring students’ details
Q12. Consider a dictionary named dict1 which contains Roll, Name and Marks of 5 students. [4]
Write code to create this dictionary. Now create a DataFrame named dfStudent from this dictionary .
Save the information contained in this dataframe to a csv file named “stud.csv”
Also write command to read the contents of the file “stud.csv” and display it to the user.