CBSE-CLASS-XII SERIES
Informatics-practice

Python Libraries

11 previous year questions.

Volume: 11 Ques
Yield: Medium

High-Yield Trend

11
2025

Chapter Questions
11 MCQs

01
PYQ 2025
medium
informatics-practice ID: cbse-cla
Write a Python program to create a Pandas Series as shown below from an ndarray containing the numbers 10, 20, 30, 40, 50 with corresponding indices 'A', 'B', 'C', 'D', 'E'.
Expected Series:
A 10
B 20
C 30
D 40
E 50
dtype: int64

02
PYQ 2025
medium
informatics-practice ID: cbse-cla
Write a Python program to create the following DataFrame using a Dictionary of Series:
Expected DataFrame:
 City State
0 Mumbai Maharashtra
1 Dehradun Uttarakhand
2 Bengaluru Karnataka
3 Hyderabad Telangana

03
PYQ 2025
medium
informatics-practice ID: cbse-cla
Rohit is trying to create a Pandas Series from scalar values. His code has some mistakes. Rewrite the correct code and mention the corrections made.
Given code with mistakes:
import pandas data = [50, 15, 40] series = pd.series(data, Index=['x', 'y', 'z']) Print(series)

04
PYQ 2025
medium
informatics-practice ID: cbse-cla
Complete the given Python code to generate the following output:
Expected output:
 COLOUR NAME QTY
0 Red Apple 10
1 Blue Berry 15
2 Green Guava 20

Given incomplete code:
import _______ as pd
data = [ {'COLOUR': 'Red', 'NAME': 'Apple', 'QTY': 10}, {'COLOUR': 'Blue', 'NAME': 'Berry', 'QTY': 15}, {_______, 'NAME': 'Guava', 'QTY': 20}
]
df = pd.DataFrame(_______)
print(_______)

05
PYQ 2025
medium
informatics-practice ID: cbse-cla
Explain how we can access elements of a Series using slicing. Give an example to support your answer.
06
PYQ 2025
medium
informatics-practice ID: cbse-cla
Mention any two main points of difference between Series and DataFrame of Python Pandas.
07
PYQ 2025
medium
informatics-practice ID: cbse-cla
In Python Pandas, DataFrame.......... [] is used for label indexing with DataFrames.
1
label
2
index
3
labeindex
4
loc
08
PYQ 2025
medium
informatics-practice ID: cbse-cla
Which of the following Python statements will be used to select a specific element having index as points, from a Pandas Series named ser?
1
ser.element(points)
2
ser.select(points)
3
ser[points]
4
ser.show[points]
09
PYQ 2025
medium
informatics-practice ID: cbse-cla
Which of the following data structure is used for storing one-dimensional labelled data in Python Pandas ?
1
Integer
2
Dictionary
3
Series
4
DataFrame
10
PYQ 2025
medium
informatics-practice ID: cbse-cla

Consider the DataFrame Doctor shown below:

Write suitable Python statements for the following:
(i) To print the last three rows of the DataFrame Doctor.
(ii) To display the names of all doctors.
(iii) To add a new column 'Discount' with value of 200 for all doctors.
(iv) To display rows with index 2 and 3.
(v) To delete the column 'Department'.
Β 

11
PYQ 2025
medium
informatics-practice ID: cbse-cla

Gurkirat has to fill in the blanks in the given Python program that generates a line plot as shown below. The given line plot represents the temperature (in degree Celsius) over five days as given in the table:

Write the missing statements according to the given specifications:
(i) Write the suitable code to import the required module in the blank space in the line marked as Statement-1.
(ii) Fill in the blank in Statement-2 with a suitable Python function name to create a line plot.
(iii) Refer to the graph shown and fill in the blank in Statement-3 to display the appropriate label for x-axis.
(iv) Refer to the graph shown and fill in the blank in Statement-4 to display the suitable chart title.
Β 

About Python Libraries - CBSE-CLASS-XII

Python Libraries is a vital chapter for CBSE-CLASS-XII aspirants. Mastering the concepts covered in this chapter is essential for securing a top rank.

By rigorously practicing the previous year questions associated with this chapter, you can identify high-yield topics, understand the examiner's perspective, and boost your confidence during the actual exam.

Frequently Asked Questions

Why focus on Python Libraries PYQs?

Analyzing PYQs for this specific chapter reveals the most frequently tested concepts and the typical complexity of questions, allowing you to tailor your study plan efficiently.

How to best use this analysis?

Review the topic breakdown to see which sub-topics within Python Libraries carry the most weight. Then, tackle the questions iteratively to solidify your understanding.