CUET Computer/IP: Informatics PracticesSeries & DataFrames. Free, no login required.

Q1:

2025: 30 May Shift 2

Series & DataFrames

Medium

Informatics Practices

State the output of the following code.

import pandas as pd

series1 = pd.Series(10,[11,22,33])

print(series1)

Answer options
Option 1
Correct Answer
Explanation for 2025: 30 May Shift 2 CSE question 1

Q2:

2025: 30 May Shift 2

Series & DataFrames

Easy

Informatics Practices

Which of the following command is used to install Pandas from command line?

Answer options
Option 2
Correct Answer
Explanation for 2025: 30 May Shift 2 CSE question 2

Q3:

2025: 30 May Shift 2

Series & DataFrames

Easy

Informatics Practices

Identify the attributes of Pandas Series that assigns a name to the Series 'ser1'.

Answer options
Option 1
Correct Answer
Explanation for 2025: 30 May Shift 2 CSE question 3

Q4:

2025: 27 May Shift 2

Series & DataFrames

Medium

Informatics Practices

What will be the output of the following code?

import pandas as pd

data={'name': pd.Series(['Ashu','Arun','Ashi']),

'age':pd.Series([25,30,22]),

'gender':pd.Series(['M','M','F'])}

df = pd.DataFrame(data)

print(df.loc[0:1,['name','age']])

Answer options
Option 1
Correct Answer
Explanation for 2025: 27 May Shift 2 CSE question 4

Q5:

2025: 27 May Shift 2

Series & DataFrames

Easy

Informatics Practices

Sometimes we need to extract a part of a series and for that we perform ______ operation.

Answer options
Option 3
Correct Answer
Explanation for 2025: 27 May Shift 2 CSE question 5

Q6:

2025: 27 May Shift 2

Series & DataFrames

Easy

Informatics Practices

How do you select rows from a DataFrame 'df', where the 'Amount' column is greater than 40000?

Answer options
Option 2
Correct Answer
Explanation for 2025: 27 May Shift 2 CSE question 6

Q7:

2025: 27 May Shift 2

Series & DataFrames

Medium

Informatics Practices

Consider a DataFrame 'df'. Which of the following statements are INCORRECT with respect to following operations?

(A) df['a'] = [30,40,50], will add a new column 'a' to the DataFrame 'df'.

(B) df.loc['a'] = [30,40,50], will add a new column 'a' to the DataFrame 'df'.

(C) df.['a'] = [30,40,50], will add a new row to the DataFrame 'df'.

(D) df.drop('a', axis =0) will delete the row with label 'a' from the DataFrame 'df'.

Answer options
Option 2
Correct Answer
Explanation for 2025: 27 May Shift 2 CSE question 7

Q8:

2025: 27 May Shift 2

Series & DataFrames

Medium

Informatics Practices

What is the correct syntax for extracting the last three rows of the DataFrame 'df'?

Answer options
Option 2
Correct Answer
Explanation for 2025: 27 May Shift 2 CSE question 8

Q9:

2025: 27 May Shift 2

Series & DataFrames

Medium

Informatics Practices

You want to create a new DataFrame 'df3' by merging two DataFrames 'df1', 'df2' on the 'Roll_no' column, then which of the following is the correct syntax for this?

Answer options
Option 1
Correct Answer
Explanation for 2025: 27 May Shift 2 CSE question 9

Q10:

2025: 22 May Shift 1

Series & DataFrames

Easy

Informatics Practices

Which parameter of the method to_csv() is used to exclude the row label to be written to the file on disk?

Answer options

Q11:

2025: 22 May Shift 1

Series & DataFrames

Medium

Informatics Practices

Which of the following are false about a DataFrame?

(A). It only allows homogeneous data.

(B). It does not allow missing values.

(C). It allows row and column indexing.

(D). It does not allow selection, deletion, addition, and renaming operations on rows and columns.

Answer options

Q13:

2025: 22 May Shift 1

Series & DataFrames

Easy

Informatics Practices

Match List-I with List-II

List-IList-II
(A). to_csv( )(I). Specifies the column labels.
(B). read_csv( )(II). Saves the file as .csv to a memory location.
(C). Header(III). Reads the file from a memory location.
(D). Sep(IV). Specifies the delimiter for values.
Answer options

Q14:

2025: 22 May Shift 1

Series & DataFrames

Easy

Informatics Practices

What will be the result when two Pandas Series being combined have mismatched indices?

Answer options

Q15:

2025: 22 May Shift 1

Series & DataFrames

Easy

Informatics Practices

Match List-I with List-II

List-IList-II
(A). loc[ ](I). Access using condition
(B). .iloc[ ](II). Access through labels
(C). Boolean indexing(III). Access through position
(D). Slicing(IV). Create a subset of the Array
Answer options

Q16:

2025: 21 May Shift 1

Series & DataFrames

Easy

Informatics Practices

df = pd. Series(['London', 'Paris', 'NewDelhi', 'Moscow'], index = ['UK', 'France', 'India', 'Russia'])

Which of the following would reverse the order of the series?

Answer options

Q17:

2025: 21 May Shift 1

Series & DataFrames

Easy

Informatics Practices

Match List-I with List-II

List-IList-II
(A). Head(I). To display dimensionality of a DataFrame
(B). Tail(II). To display the first 'n' elements of a DataFrame
(C). Shape(III). To display the total number of elements in a DataFrame
(D). Size(IV). To display the last 'n' elements of a DataFrame
Answer options

Q18:

2025: 21 May Shift 1

Series & DataFrames

Easy

Informatics Practices

When positional indices are used for __________, the value at end index position is excluded.

Answer options

Q19:

2025: 21 May Shift 1

Series & DataFrames

Medium

Informatics Practices

Consider the following table:

PriyaRichaRohitSohamRiya
Maths8587847690
Science8676866692
Hindi9291836897
English9081907594

Which code represents the creation of a slice containing 'Priya' and 'Richa' marks in 'Maths' and 'Science' if the dataframe is represented using 'df' ?

(A). df.loc['Maths', 'Science', 'Priya' : 'Richa']

(B). df.loc['Maths' : 'Science', 'Priya', 'Richa']

(C). df.loc['Maths': 'Science', ['Priya', 'Richa']]

(D). df.loc[['Maths', 'Science'], ['Priya', 'Richa']]

Answer options

Q20:

2025: 21 May Shift 1

Series & DataFrames

Easy

Informatics Practices

Consider the following table:

PriyaRichaRohitSohamRiya
Maths8587847690
Science8676866692
Hindi9291836897
English9081907594

How to delete columns having the labels 'Rohit' and 'Soham' if the dataframe is represented using 'df' ?

Answer options

Q21:

2025: 20 May Shift 1

Series & DataFrames

Easy

Informatics Practices

Match List-I with List-II

List-IList-II
(A) rename()(I) To display rows of a series from the top.
(B) tail()(II) To change the name of a row or column in a DataFrame.
(C) drop()(III) To display rows of a DataFrame from the bottom.
(D) head()(IV) To delete a row or column in a DataFrame.
Answer options

Q22:

2025: 20 May Shift 1

Series & DataFrames

Easy

Informatics Practices

Arrange the following statements to create a series from a list.

(A) Define a list

(B) Import pandas library

(C) Display the series

(D) Create the series

Answer options

Q23:

2025: 20 May Shift 1

Series & DataFrames

Easy

Informatics Practices

A DataFrame can be created from:-

(A) Dictionary of lists

(B) List of dictionaries

(C) Numpy array

(D) Series

Answer options

Q24:

2025: 20 May Shift 1

Series & DataFrames

Easy

Informatics Practices

On the basis of the following series 'ser1', state the output of the command that follows:

ser1

a100
b900
c700
d200
e500

print(ser1[ser1>700])

Answer options

Q25:

2025: 20 May Shift 1

Series & DataFrames

Hard

Informatics Practices

Which of the following are the correct commands to change the name of a row in a DataFrame 'df1'?

(A) df1.rename({old name:new name},axis='rows',inplace=True)

(B) df1.rename({old name:new name},axis=0,inplace=True)

(C) df1.rename({old name:new name},axis='index',inplace=True)

(D) df1=df1.rename({old name:new name},axis='rows',inplace=True)

Answer options

Q26:

2025: 16 May Shift 1

Series & DataFrames

Medium

Informatics Practices

What will be the output of the loc[] pandas operation?

Answer options

Q27:

2025: 16 May Shift 1

Series & DataFrames

Easy

Informatics Practices

Which of the following is a valid way to create a pandas series from a dictionary?

Answer options

Q28:

2025: 16 May Shift 1

Series & DataFrames

Medium

Informatics Practices

Which of the following are valid ways to create a pandas DataFrame?

(A) From the dictionary of the lists

(B) From a list of dictionaries

(C) From a NumPy array

(D) From a scalar value

Answer options

Q29:

2025: 16 May Shift 1

Series & DataFrames

Easy

Informatics Practices

Arrange the following steps to access rows in a pandas DataFrame using Boolean indexing.

(A) Store or display the results

(B) Pass the condition as an index to the DataFrame

(C) Define or create a DataFrame

(D) Write condition to filter rows

Answer options

Q30:

2025: 16 May Shift 1

Series & DataFrames

Easy

Informatics Practices

Arrange the following steps to export Pandas DataFrame to a CSV file in correct sequence:

(A) Use the to_csv() function

(B) Create and define DataFrame

(C) Save the changes

(D) Provide the file name or path as an argument

Answer options