CUET Computer/IP: Informatics PracticesPandas Data Analysis. Free, no login required.

Q1:

2025: 27 May Shift 2

Pandas Data Analysis

Medium

Informatics Practices

Which of the following are the valid ways to calculate the average marks in 'Maths'?

(A) df['Maths'].mean()

(B) df.loc[:,'Maths'].mean()

(C) df.query('Maths').mean()

(D) df['Maths'].aggregate('mean')

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

Q2:

2025: 27 May Shift 2

Pandas Data Analysis

Easy

Informatics Practices

What is the purpose of the reset_index() in pandas?

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

Q3:

2025: 27 May Shift 2

Pandas Data Analysis

Easy

Informatics Practices

What does NaN indicates?

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

Q4:

2025: 27 May Shift 2

Pandas Data Analysis

Medium

Informatics Practices

Which of the following functions will read a SQL query into a DataFrame using the connection identifier 'sql_conn'?

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

Q5:

2025: 22 May Shift 1

Pandas Data Analysis

Medium

Informatics Practices

NameUnit TestMathsScienceHindiEnglish
Riya127262425
Riya226252624
Riya319242823
Arun128232522
Arun229262424
Arun317282319
Rohit120262426
Rohit223252625
Rohit322222723

The above DataFrame is created as 'df'. To print the total marks scored by Arun in all subjects in each unit test, we can use:

Answer options
Option 1
Correct Answer
Explanation for 2025: 22 May Shift 1 CSE question 5

Q6:

2025: 22 May Shift 1

Pandas Data Analysis

Medium

Informatics Practices

Match List-I with List-II

List-IList-II
(A). pivot( )(I). Transform and produce a single value from an array.
(B). GROUP BY( )(II). Split - apply - combine.
(C). pivot_table( )(III). Reshape and create a new DataFrame from the original.
(D). aggregate( )(IV). Aggregates the values from rows with duplicate entries for the specified columns.
Answer options
Option 2
Correct Answer
Explanation for 2025: 22 May Shift 1 CSE question 6

Q7:

2025: 22 May Shift 1

Pandas Data Analysis

Easy

Informatics Practices

You have two dataframes 'df1' and 'df2' having ID columns as common. To merge these two dataframes with only the common indices, we use (assuming pandas as pd is imported):

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

Q8:

2025: 22 May Shift 1

Pandas Data Analysis

Medium

Informatics Practices

data = {'Store: ['Shop1', 'Shop'3, 'Shop1', 'Shop2', 'Shop3', 'Shop1', 'Shop2', 'Shop3'],

'Sales(Rs)': [15000, 36000, 45000, 24000, 10000, 43000, 32000, 15000],

'Year': [2016, 2016, 2017, 2017, 2017, 2018, 2018, 2018],

'Profit': [1200, 5600, 3400, 8000, 4800, 3500, 2400, 12000]}

The above DataFrame was created as 'df'. To find the maximum sale for Store 'Shop2', we will use _______.

Answer options
Option 4
Correct Answer
Explanation for 2025: 22 May Shift 1 CSE question 8

Q9:

2025: 22 May Shift 1

Pandas Data Analysis

Easy

Informatics Practices

During the handling of missing values, in which function we use 'inplace = True' parameter in pandas to make changes in original DataFrame?

Answer options
Option 3
Correct Answer
Explanation for 2025: 22 May Shift 1 CSE question 9

Q10:

2025: 22 May Shift 1

Pandas Data Analysis

Easy

Informatics Practices

.fillna(method = 'pad') replaces the missing value by _________ .

Answer options

Q11:

2025: 21 May Shift 1

Pandas Data Analysis

Easy

Informatics Practices

Arrange the following Python statements in correct order to export data from pandas to MYSQL:

(A). Import necessary libraries.

(B). Use to_sql() function to export the data.

(C). Create data frame and pass the parameters if needed.

(D). Use the engine=create_engine() function to establish a connection.

Answer options

Q12:

2025: 21 May Shift 1

Pandas Data Analysis

Medium

Informatics Practices

___________ is used to read either an sql query or an sql table into a DataFrame using the connection identifier (sql_conn).

Answer options

Q13:

2025: 21 May Shift 1

Pandas Data Analysis

Easy

Informatics Practices

Which of the following are aggregate functions?

(A). max( )

(B). sum( )

(C). count( )

(D). std( )

Answer options

Q14:

2025: 21 May Shift 1

Pandas Data Analysis

Easy

Informatics Practices

Arrange the following in order of their occurrence.

(A). Use isnull() to find the missing values.

(B). Use fillna() to fill in the missing values.

(C). Import pandas and read csv.

(D). Use pd.get_dummies for label encoding.

Answer options

Q16:

2025: 21 May Shift 1

Pandas Data Analysis

Easy

Informatics Practices

To find the total number of NaN values in each column, we use _____.

Answer options

Q17:

2025: 21 May Shift 1

Pandas Data Analysis

Easy

Informatics Practices

Which of the following function is used to identify the null values in a dataframe?

(A). isnull( )

(B). isna( )

(C). isempty( )

(D). findnull( )

Answer options

Q18:

2025: 21 May Shift 1

Pandas Data Analysis

Easy

Informatics Practices

Which of the following is correct for the continuous data _________?

(A). Can be measured

(B). Can be in categories

(C). Can be in decimals

(D). Can be discrete

Answer options

Q19:

2025: 20 May Shift 1

Pandas Data Analysis

Easy

Informatics Practices

The descriptive statistical function of pandas, which is used to display the value which appears most number of times in each row and column of a DataFrame (df) is _______.

Answer options

Q20:

2025: 20 May Shift 1

Pandas Data Analysis

Easy

Informatics Practices

Pandas provides ___________ function to check for the missing values in a DataFrame.

Answer options

Q21:

2025: 20 May Shift 1

Pandas Data Analysis

Easy

Informatics Practices

The descriptive statistical function of pandas which is used to display the sum of the values of a DataFrame (df) regardless of its datatype is_______.

Answer options

Q22:

2025: 20 May Shift 1

Pandas Data Analysis

Easy

Informatics Practices

Pandas provides ____ function to sort the data values of a DataFrame.

Answer options

Q23:

2025: 20 May Shift 1

Pandas Data Analysis

Easy

Informatics Practices

While transferring the data from a DataFrame to CSV file, if we do not want the row labels to be written to the file on the disk, the parameter to be used in to_csv() is _____________.

Answer options

Q24:

2025: 20 May Shift 1

Pandas Data Analysis

Medium

Informatics Practices

DataFrame.quartile() is used to get quartiles. By default DataFrame.quartile() will display ____ quantile.

Answer options

Q25:

2025: 20 May Shift 1

Pandas Data Analysis

Easy

Informatics Practices

Match List-I with List-II

List-IList-II
(A) DataFrame.sum()(I) To display the middle values of a data .
(B) DataFrame.median()(II) To display the sum of values of a DataFrame.
(C) DataFrame.quantile(q=.25)(III) To display the average of squared differences from the mean.
(D) DataFrame.var()(IV) First quartile
Answer options

Q26:

2025: 16 May Shift 1

Pandas Data Analysis

Easy

Informatics Practices

Which of the following is used to drop the row having NaN value?

Answer options

Q27:

2025: 16 May Shift 1

Pandas Data Analysis

Easy

Informatics Practices

fillna(num) function is used in pandas for:-

Answer options

Q28:

2025: 16 May Shift 1

Pandas Data Analysis

Easy

Informatics Practices

Which of the following are descriptive statistics methods?

(A) df.max()

(B) df.sum()

(C) df.median()

(D) df.quantile()

Answer options

Q29:

2025: 16 May Shift 1

Pandas Data Analysis

Easy

Informatics Practices

Arrange the following steps for using Group by functions in Pandas:

(A) Import relevant libraries

(B) Apply the required function

(C) Split the data into groups by creating a Group by objects from the original DataFrame

(D) Combine results into a new DataFrame

Answer options

Q30:

2025: 16 May Shift 1

Pandas Data Analysis

Easy

Informatics Practices

Match the following DataFrame methods with their description:

List-IList-II
(A) add()(I) change data type of a column
(B) drop_duplicates()(II) add value along a row or column
(C) GROUP BY()(III) group data based on column
(D) stype()(IV) remove duplicate rows
Answer options