Q1:
2026: 31 May Shift 1
Informatics Practices
Pandas Data Analysis
Easy
Informatics Practices
Calculate the median for the following values.
21, 14, 20, 23, 22, 23, 24, 12, 15, 18, 17
2026: 31 May Shift 1
Informatics Practices
Pandas Data Analysis
Easy
Informatics Practices
Calculate the median for the following values.
21, 14, 20, 23, 22, 23, 24, 12, 15, 18, 17
2026: 31 May Shift 1
Informatics Practices
Pandas Data Analysis
Easy
Informatics Practices
____ means transform a dataset and produce a single numerical value from an array.
2026: 31 May Shift 1
Informatics Practices
Pandas Data Analysis
Hard
Informatics Practices
Consider the following DataFrame 'df':
| Item | Color | Price(Rs) | Units_in_stock | |
|---|---|---|---|---|
| 0 | Pen | Red | 10 | 50 |
| 1 | Pen | Red | 25 | 10 |
| 2 | Pencil | Black | 7 | 47 |
| 3 | Pencil | Black | 5 | 34 |
| 4 | Pen | Blue | 50 | 55 |
| 5 | Pen | Blue | 20 | 14 |
pivot3=df.pivot(index='Item', columns='Color ', values='Units_in_stock')
What will be the output of the above statement?
2026: 31 May Shift 1
Informatics Practices
Pandas Data Analysis
Medium
Informatics Practices
The following function fills the missing values with next entry:
2026: 31 May Shift 1
Informatics Practices
Pandas Data Analysis
Easy
Informatics Practices
Arrange the following steps to perform a multi-column sort in pandas:
A. import pandas as pd
B. use .sort_values() with multiple columns and ascending parameter
C. load data into DataFrame
D. display the sorted DataFrame
2026: 31 May Shift 1
Informatics Practices
Pandas Data Analysis
Easy
Informatics Practices
The function used for reshaping the data is____.
2026: 29 May Shift 2
Informatics Practices
Pandas Data Analysis
Medium
Informatics Practices
To find the number of missing values in the whole DataFrame 'df', which of the following statements is correct?
A. df.isna().sum().sum()
B. df.isnull.sum()
C. df.isnull.sum().sum()
D. df.isna.sum()
2026: 29 May Shift 2
Informatics Practices
Pandas Data Analysis
Medium
Informatics Practices
Match the LIST-I with LIST-II
| LIST-I | LIST-II | ||
|---|---|---|---|
| A. | sqlalchemy | I. | function to save a DataFrame to a text or csv file |
| B. | pymysql | II. | contains connection string |
| C. | create_engine() | III. | to install the database driver |
| D. | to_csv( ) | IV. | provides a function create_engine() that enables the connection to be established |
2026: 29 May Shift 2
Informatics Practices
Pandas Data Analysis
Easy
Informatics Practices
The default aggregate function in the context of "pivot tables" is ______________.
2026: 29 May Shift 2
Informatics Practices
Pandas Data Analysis
Medium
Informatics Practices
A DataFrame 'df' has columns 'Mobile_brands' and 'unit_sold'. How will you calculate the total 'unit_sold' for each 'Mobile_brand' using groupby function?
2026: 29 May Shift 2
Informatics Practices
Pandas Data Analysis
Medium
Informatics Practices
There is a DataFrame 'df' with column 'Gender' and 'Salary'. How to calculate the average of the 'Salary' for each 'Gender' using pivot function?
2026: 29 May Shift 1
Informatics Practices
Pandas Data Analysis
Easy
Informatics Practices
Which of the following functions does Pandas provide to reshape the DataFrame?
2026: 29 May Shift 1
Informatics Practices
Pandas Data Analysis
Easy
Informatics Practices
Which of the following functions does not come under the category of statistical functions in Pandas?
2026: 29 May Shift 1
Informatics Practices
Pandas Data Analysis
Easy
Informatics Practices
Data can be loaded in a DataFrame from a CSV file on the disk by using Pandas _______function.
2026: 29 May Shift 1
Informatics Practices
Pandas Data Analysis
Easy
Informatics Practices
df.fillna(method='pad') replaces the missing value by the value _____the missing value.
2026: 29 May Shift 1
Informatics Practices
Pandas Data Analysis
Easy
Informatics Practices
Which statistical function of pandas is used to display the average of squared differences from the mean?
2026: 29 May Shift 1
Informatics Practices
Pandas Data Analysis
Easy
Informatics Practices
DataFrame.max() is used to calculate the maximum values from the DataFrame, regardless of its data types. If we want to output maximum value for the columns having only numeric values, then we can set the parameter numeric_only as ___ in the max() method.
2026: 29 May Shift 1
Informatics Practices
Pandas Data Analysis
Easy
Informatics Practices
Which of the following Pandas function checks whether any value is missing or not in the DataFrame?
2026: 26 May Shift 1
Informatics Practices
Pandas Data Analysis
Medium
Informatics Practices
Consider the following DataFrame 'df' where the sales made by the companies in 3 quarters, is given:
| Name | Quarter | Sedan | Hatchback | Coupe | SUV |
|---|---|---|---|---|---|
| Ford | 1 | 50 | 60 | 40 | 80 |
| Ford | 2 | 40 | 50 | 60 | 70 |
| Ford | 3 | 45 | 57 | 33 | 64 |
| Mahindra | 1 | 60 | 70 | 50 | 49 |
| Mahindra | 2 | 40 | 50 | 30 | 60 |
| Mahindra | 3 | 55 | 60 | 45 | 76 |
| Honda | 1 | 48 | 54 | 39 | 66 |
| Honda | 2 | 41 | 58 | 32 | 63 |
| Honda | 3 | 59 | 67 | 42 | 79 |
Find the average sale made by each company in each quarter.
2026: 26 May Shift 1
Informatics Practices
Pandas Data Analysis
Medium
Informatics Practices
| Name | Maths | Physics | Chemistry | English |
|---|---|---|---|---|
| Manish | 40 | 50 | 80 | 70 |
| Zainab | 60 | 70 | 50 | |
| Richa | 45 | 65 | 75 | |
| Rohit | 90 | 78 | 72 | 69 |
| Suman | 63 | 78 | 64 | |
| Atul | 74 | 82 | 74 | |
| Charu | 66 | 88 | 75 |
In the DataFrame 'df' given above, which of the following statement will find the total number of NaN in the whole dataset?
2026: 26 May Shift 1
Informatics Practices
Pandas Data Analysis
Easy
Informatics Practices
Arrange the following functions of GROUP BY according to its working strategy:
(A) Combine the results
(B) Split the data
(C) Create the input DataFrame
(D) Apply the function
2026: 26 May Shift 1
Informatics Practices
Pandas Data Analysis
Medium
Informatics Practices
Which of the following command is NOT valid to fetch data from the table of the database?
2026: 26 May Shift 1
Informatics Practices
Pandas Data Analysis
Medium
Informatics Practices
| Store | Year | Total_Sales | Total_profit | |
|---|---|---|---|---|
| 0 | S1 | 2016 | 150000 | 15000 |
| 1 | S4 | 2016 | 400000 | 40000 |
| 2 | S3 | 2016 | 450000 | 45000 |
| 3 | S1 | 2017 | 350000 | 35000 |
| 4 | S2 | 2016 | 120000 | 12000 |
| 5 | S4 | 2017 | 450000 | 45000 |
| 6 | S3 | 2017 | 500000 | 50000 |
In the DataFrame 'df' given above, there is a need for maximum sale for store 'S1' in any year. Which query will be appropriate for the problem?
(A) max_sales = df[df.Store == 'S1']
max_sales['Total_Sales'].max()
(B) max_sales = df[df['Store'] == 'S1']
max_sales['Total_Sales'].max()
(C) max_sales = df[df.Store == 'S1']
max_sales.df['Total_Sales'].max()
(D) max_sales = df[df['Store'] == 'S1']
max_sales.df['Total_Sales'].max()
2026: 24 May Shift 1
Informatics Practices
Pandas Data Analysis
Medium
Informatics Practices
What will be the output of df.isnull().any()?
2026: 24 May Shift 1
Informatics Practices
Pandas Data Analysis
Medium
Informatics Practices
Which of the following functions are used to split the data into groups based on some criteria?
2026: 24 May Shift 1
Informatics Practices
Pandas Data Analysis
Easy
Informatics Practices
Arrange the following steps to calculate the total number of values for each row of a DataFrame.
(A) Load the DataFrame as 'df'
(B) Use the df.count() method
(C) Print the result
(D) import pandas as pd
2026: 24 May Shift 1
Informatics Practices
Pandas Data Analysis
Medium
Informatics Practices
What will be the output of the command df.count(axis = 1)?
2026: 24 May Shift 1
Informatics Practices
Pandas Data Analysis
Medium
Informatics Practices
What does pivot_table( ) do in pandas that pivot( ) cannot?
2026: 24 May Shift 1
Informatics Practices
Pandas Data Analysis
Easy
Informatics Practices
_________ will display the total number of values for each column or row of a DataFrame.
2026: 23 May Shift 2
Informatics Practices
Pandas Data Analysis
Easy
Informatics Practices
Arrange the steps to split the data in to groups using the GROUP BY() based on some criteria:
A. Apply the required function.
B. Print the new DataFrame.
C. Combine the results to form a new DataFrame.
D. Split the data into groups by creating a GROUP BY object from the original DataFrame.