You are on page 1of 2

CLASS - XII (SET 1)

INFORMATICS PRACTICES (065)


MAY TEST (2021-2022
Max Marks: 30 Time: 1:00 Hrs

General instructions: There are 25 question and all questions are compulsory.

Case study based questions from question 1 to 5. (1 Mark each)

Vaanika has created the following data frame dataframe1 to keep track of data Rollno, Name,
Marks1 and Marks2 for various students of her class where row indexes are taken as the default
values:

Rollno Name Marks1 Marks2


1 Swapnil 30 50
2 Raj Batra 75 45
3 Bhoomi Singh 82 95
4 Jay Gupta 90 95

Q1. Write a statement that give 90, 95 as output.

Q2. Write a statement to know the marks scored by Rollno 2.


Q3. Write a statement to delete the 3rd column.

Q4. Write a statement to display the total number of elements in the dataframe.

Q5. Write a statement to add a column Marks3 with relevant data

Very short answer type questions from question 6 to 20. (1 Mark each)
Q6. What is the significance of Pandas library?

Q7. Write code to create a Series object using the Python sequence [3, 5, 7, 9] .

Q8. What is the Dataframe data structure of Python pandas?

Q9. What will the output of the following code.

Data = np.array ( [‘a1’, ‘b1’, c1’, ‘d1’, ‘e1 ] )

s = pd. Series (data, index = [ 1001, 1002, 1003, 1004, 1005 ] )

Print( s [ [1002, 1003, 1004 ] ] )

Q10. How to check if a Dataframe df has any missing values?


Find the error in following code fragment:
Q11. s2 = pd.Series ( [101, 102, 103, 104 ] )

Print (s2.index)

s2.index = [ 0, 1, 2, 3, 4, 5 ]

s2 [5] = 220

print (s2)

Q12. s = pd.Series (2, 3, 4, 5, index = range (4) )

Q13. s1 = pd.Series (1, 2, 3, 4, index = range (7) )

Q14. s2 = pd.Series ( [1, 2, 3, 4 ], index = range (4) )

Q15.Make a pandas Dataframe with 2D list.

Q16. What command is used to install Pandas?

Q17. What does by mean that axis = 0 in Dataframe?

Q18.What attribute of dataframe is used to perform the transpose operation on a dataframe?

Q19.What does mean by Dataframe is size – mutable?

Q20. What method is used to access subset of a dataframe?

Short answer type questions from question 20 to 25 (2 Marks each)


Q21. Write a small python code to create a Dataframe with headings (a and b ) from the list
given below.
[[ 1,2 ], [ 3,4 ], [ 5,6 ], [ 7,8 ]]

Q22. Write a python program to sort the data of student dataframe based on marks.

Q23. Write a python program to generate a series using mathematical exponentiation.

Q24. Write a python program to modifying a column in a Dataframe.

Q25. How to create a series from a constant value.

You might also like