0% found this document useful (0 votes)
242 views2 pages

Unit Test 1 IP Class12 2021

The document contains 12 questions regarding data series, dataframes and data visualization in Python. It involves creating data series and dataframes from lists and dictionaries, performing operations on dataframes like selecting rows and columns, creating basic line and bar plots with labels and titles, and saving a dataframe to a CSV file.

Uploaded by

p
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
242 views2 pages

Unit Test 1 IP Class12 2021

The document contains 12 questions regarding data series, dataframes and data visualization in Python. It involves creating data series and dataframes from lists and dictionaries, performing operations on dataframes like selecting rows and columns, creating basic line and bar plots with labels and titles, and saving a dataframe to a CSV file.

Uploaded by

p
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

UNIT TEST - INFORMATICS PRACTICES ( CLASS XII )

Max. Marks 35 Timing 8.00 a.m to 9.30 a.m ( 1 hr 30 mins )

Q1. Explain Data Series with a suitable example. [1]

Q2. Write Python code to create an empty Series. [1]


Q3. Consider a list [3]

L = [ 10, 20, 30, 40, 50 ]

Write python code to create a Series from the above List with index as A1, B1, C1, D1, E1

Q4. Consider the following panda series S8 [2]

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

Q8. Explain Data Visualizatio. Explain its importance. [2]


Q9. (a) Write Python code to create a DataFrame for the following data . [4]
Name Age Designation
I1 Yamini 35 Principal
I2 Dinesh 40 System Manager
I3 Shyam 50 Teacher

Q10. A dictionary contains the following data : [5]

Grade = { ‘Name’ : [ ‘Rashmi’, ’Harsh’, ’Ganesh’, ’Priya’, ’Vivek’, ’Anita’, ’Kartik ’] ,


‘Grade’: [ ‘A1’, ‘A2’, ’B1’, ’A1’ , ’B2’, ’A2’, ’A1’ ] }
Write statements for the following :
(a) Create a dataframe called Gr.
(b) Add a column called Percentage with following data :
[ 92, 89, None, 95, 68, None, 93 ]
(c) Drop the column ( i.e Grade ) by name
(d) Delete the 3rd and 5th rows.
(e) Find the output of Gr.iloc[0:5] and Gr[0:5]

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.

You might also like