CUET-UG SERIES
Computer-science

Pandas

7 previous year questions.

Volume: 7 Ques
Yield: Medium

High-Yield Trend

6
2025
1
2023

Chapter Questions
7 MCQs

01
PYQ 2023
medium
computer-science ID: cuet-ug-
The way a dataset is arranged into rows and columns is referred to as the shape of data. Following function is used to reshape and create a new DataFrame from the original one:
1
dropna()
2
pivot()
3
sort()
4
merge()
\textbf{Correct Answer:} (2) pivot()
02
PYQ 2025
medium
computer-science ID: cuet-ug-

Which of the following are the correct commands to delete a column from the DataFrame df1?

1
df1 = df1.drop(column_name, axis=1)
2
df1.drop(column_name, axis=columns, inplace=True)
3
df1.drop(column_name, axis='columns', inplace=True)
4
df1.drop(column_name, axis=1, inplace=True)
03
PYQ 2025
medium
computer-science ID: cuet-ug-
Which of the following is the correct command to display the top 2 records of Series \texttt{tail}?
1
print(s1.head(2))
2
print(tail.head())
3
print(tail.head(0))
4
print(tail.head(2))
04
PYQ 2025
medium
computer-science ID: cuet-ug-

Consider the given DataFrame df4:

NAMEPERIODICENGMATHSSCIENCE
MEENA1406080
REENA2603010
TEENA3806040
SHEENA2902070

We want the following output:

NAMEMEENAREENATEENASHEENA
PERIODIC8
ENG270
MATHS170
SCIENCE200
1
print(df4.sum(numeric_only=True))
2
print(df4.sum(numeric_only=False))
3
print(df4.sum())
4
print(df4.count(numeric_only=True))
05
PYQ 2025
medium
computer-science ID: cuet-ug-

Given the following DataFrame df:

PNONAME
111ROHAN
222MEETA
333SEEMA
444SHALU
555POONAM

Select the correct commands from the following to display the last five rows:

1
print(df.tail(-5))
2
print(df.head(-5))
3
print(df.tail())
4
print(df.tail(5))
06
PYQ 2025
medium
computer-science ID: cuet-ug-
The process of changing the structure of a DataFrame using function pivot() is known as .............
1
Transpose
2
Reindexing
3
Resetting
4
Reshaping
07
PYQ 2025
medium
computer-science ID: cuet-ug-

Given the following series ser1:

IndexValue
069
180
220
350
4100
570

State the output of the following command:

print(ser1 >= 70)

1
IndexValue
1 80
4100
570
2
IndexResult
0F
1T
2F
3F
4T
5T
3
IndexCondition
1T
4T
5T
4
IndexValue
1 80
4100