Q1:
2026: 31 May Shift 1
Informatics Practices
Series & DataFrames
Easy
Informatics Practices
Which of the following statement is correct to display the first 3 rows of a DataFrame 'df'?
2026: 31 May Shift 1
Informatics Practices
Series & DataFrames
Easy
Informatics Practices
Which of the following statement is correct to display the first 3 rows of a DataFrame 'df'?
2026: 31 May Shift 1
Informatics Practices
Series & DataFrames
Easy
Informatics Practices
Which of the following is used for label based indexing?
2026: 31 May Shift 1
Informatics Practices
Series & DataFrames
Easy
Informatics Practices
Arrange the following steps in the correct order to create a Pandas Series from a dictionary and displaying the elements.
A. import pandas as pd
B. s= pd.Series(data)
C. print(s)
D. data= {'A':10, 'B':20, 'C":30}
2026: 31 May Shift 1
Informatics Practices
Series & DataFrames
Easy
Informatics Practices
Which of the following function is used to read from a 'csv' file into a pandas ('pd' as alias) DataFrame?
2026: 31 May Shift 1
Informatics Practices
Series & DataFrames
Easy
Informatics Practices
Which of the following statement is used to export a DataFrame to 'csv' file?
2026: 31 May Shift 1
Informatics Practices
Series & DataFrames
Easy
Informatics Practices
Match the LIST-I with LIST-II
| LIST-I | LIST-II | ||
|---|---|---|---|
| A. | df.loc['Science'] | I. | Merging |
| B. | df.loc['Maths']>90 | II. | Slicing |
| C. | df.loc['Maths':'Science'] | III. | Boolean Indexing |
| D. | df1=df1.append(df2) | IV. | Label based indexing |
2026: 29 May Shift 2
Informatics Practices
Series & DataFrames
Easy
Informatics Practices
__________ implies that column names are inferred from the first line of the file while using Pandas read_csv() function.
2026: 29 May Shift 2
Informatics Practices
Series & DataFrames
Medium
Informatics Practices
What will be the output of the following commands?
seriesCapCntry = pd.Series(['NewDelhi', 'WashingtonDC', 'London', 'Paris'], index=['India', 'USA', 'UK', 'France'])
seriesCapCntry[1:3]
2026: 29 May Shift 2
Informatics Practices
Series & DataFrames
Medium
Informatics Practices
Which of the statements are INCORRECT with respect to DataFrame (df) operations?
A. df['a'] = ['1','2','3','4']_____________ will add a new column 'a' in the DataFrame
B. df.loc['a'] = ['1','2','3','4']________ will add a new column 'a' to the DataFrame
C. df.drop('a', axis = 0)____________ will drop the row label 'a' from the DataFrame
D. df['a'] = ['1','2','3','4']_____________ will add a new row 'a' in the DataFrame
2026: 29 May Shift 2
Informatics Practices
Series & DataFrames
Hard
Informatics Practices
Consider a DataFrame 'ResultDF' as follows:
| Arnab | Ramit | Samridhi | Riya | Mallika | |
|---|---|---|---|---|---|
| Maths | 90 | 92 | 89 | 81 | 94 |
| Science | 91 | 81 | 91 | 71 | 95 |
| Hindi | 97 | 96 | 88 | 67 | 99 |
Arrange the following commands on the basis of number of values in the output in increasing order:
A. ResultDF.loc['Science']
B. ResultDF.loc[:,'Arnab']
C. ResultDF.loc[['Science', 'Hindi']]
D. ResultDF.loc['Maths'] > 90
2026: 29 May Shift 2
Informatics Practices
Series & DataFrames
Easy
Informatics Practices
| S_id | Physics | Chemistry | Maths |
|---|---|---|---|
| 1 | 67 | 45 | 87 |
| 2 | 58 | 65 | 76 |
| 3 | 59 | 47 | 69 |
| 4 | 66 | 79 | 71 |
From the table given above, a DataFrame 'df' is created. What will be the query to fetch maximum marks in chemistry?
2026: 29 May Shift 2
Informatics Practices
Series & DataFrames
Medium
Informatics Practices
Considering s1 = pd.Series([2,3,np.nan,7, np.nan,9,11])
What will be the output of the following statement?
s1.dropna().tail(4)
2026: 29 May Shift 2
Informatics Practices
Series & DataFrames
Easy
Informatics Practices
A Series is a ________ which by default have _________ data labels.
2026: 29 May Shift 1
Informatics Practices
Series & DataFrames
Medium
Informatics Practices
Which of the following statements are TRUE with respect to data handling uisng Pandas?
(A) A Series is a one-dimensional array containing a sequence of values.
(B) DF = DF.drop(['Samridhi','Ramit','Riya'], axis=1) will delete the columns having labels 'Samridhi', 'Ramit' and 'Riya'.
(C) DataFrame.loc[ ] is used for label based indexing of rows in DataFrames.
(D) Pandas.DataFrame.append() method is used to merge two DataFrames.
2026: 29 May Shift 1
Informatics Practices
Series & DataFrames
Easy
Informatics Practices
Arrange the following python statement for creation of Series from Dictionary:
(A) print(dict1)
(B) print(series1)
(C) dict1 = {'India': 'NewDelhi', 'UK': 'London', 'Japan': 'Tokyo'}
(D) series1 = pd.Series(dict1)
2026: 29 May Shift 1
Informatics Practices
Series & DataFrames
Medium
Informatics Practices
State the output of the following code fragment.
import pandas as pd
listDict = [{'a':10, 'b':20}, {'a':5, 'b':10, 'c':20}]
dF = pd.DataFrame(listDict)
print(dF)
2026: 29 May Shift 1
Informatics Practices
Series & DataFrames
Easy
Informatics Practices
Match List-I with List-II
| List-I | List-II |
|---|---|
| (A) DataFrame.head() | (I) To display row labels. |
| (B) DataFrame.T | (II) To display a tuple representing the dimensionality of the DataFrame. |
| (C) DataFrame.shape | (III) Row indices and column labels of the DataFrame replace each other’s position. |
| (D) DataFrame.index | (IV) To display the first 5 rows in the DataFrame. |
2026: 29 May Shift 1
Informatics Practices
Series & DataFrames
Medium
Informatics Practices
Help Mohan for displaying a column of a DataFrame 'DF' as he is confused among the following options.
(A) DF.loc['COLUMN NAME']
(B) DF[COLUMN NAME]
(C) DF.COLUMN NAME
(D) DF['COLUMN NAME']
2026: 26 May Shift 1
Informatics Practices
Series & DataFrames
Medium
Informatics Practices
Which of the following statements are TRUE?
(A) Addition of a new row to a DataFrame 'df' can be acheived with the help of df.loc[]
(B) Pandas.DataFrame.append() method is used to merge two DataFrames.
(C) Slicing is the only way to access elements of a series.
(D) DataFrame.D gives the transpose of a DataFrame.
2026: 26 May Shift 1
Informatics Practices
Series & DataFrames
Easy
Informatics Practices
Consider the following Dataframe 'df':
| Subject | Amit | Ashu | Atul | Arnab |
|---|---|---|---|---|
| Maths | 80 | 85 | 82 | 90 |
| Science | 75 | 70 | 79 | 83 |
| Hindi | 82 | 84 | 88 | 78 |
| English | 80 | 70 | 79 | 81 |
To drop a columns having label 'Amit' and 'Atul', which of the following statement is valid?
2026: 26 May Shift 1
Informatics Practices
Series & DataFrames
Medium
Informatics Practices
Consider the following statement:
Country = pd.Series(['India','Nepal','Germany','Poland','USA'])
What will the following command result in?
print (Country [: : -1])
2026: 26 May Shift 1
Informatics Practices
Series & DataFrames
Easy
Informatics Practices
Consider the following 'SeriesA' and 'SeriesB':
SeriesA
| Index | |
|---|---|
| a | 2 |
| b | 4 |
| c | 0 |
| d | 8 |
| e | 0 |
| f | 10 |
SeriesB
| Index | |
|---|---|
| a | 10 |
| b | -20 |
| c | -5 |
| d | 10 |
| e | 100 |
| f | 50 |
What will be the output of SeriesA * SeriesB?
2026: 26 May Shift 1
Informatics Practices
Series & DataFrames
Medium
Informatics Practices
In any DataFrame 'df', if we want to perform sorting on a column name then which of the following is the correct syntax to do it?
2026: 26 May Shift 1
Informatics Practices
Series & DataFrames
Medium
Informatics Practices
Consider a DataFrame 'df' given below.
| Subject | Amit | Ashu | Atul | Arnab |
|---|---|---|---|---|
| Maths | 80 | 85 | 82 | 90 |
| Science | 75 | 70 | 79 | 83 |
| Hindi | 82 | 84 | 88 | 78 |
| English | 80 | 70 | 79 | 81 |
Which of the following statement will display name of the student and True or False depending on satisfying the condition of student having scored more than 90 in Maths?
2026: 26 May Shift 1
Informatics Practices
Series & DataFrames
Easy
Informatics Practices
If data needs to be imported in a DataFrame from a csv file where values are separated via space, then which of the following syntax would be correct?
2026: 24 May Shift 1
Informatics Practices
Series & DataFrames
Medium
Informatics Practices
In data handling, pandas support ________ index values.
2026: 24 May Shift 1
Informatics Practices
Series & DataFrames
Medium
Informatics Practices
While appending two dataframes, if we want to raise error in case row labels are duplicate, we shall use which parameter of append() method?
2026: 24 May Shift 1
Informatics Practices
Series & DataFrames
Easy
Informatics Practices
Order the following steps to for creation of series from NumPy Arrays.
(A) >>> import numpy as np
(B) >>> array1 = np.array([1,2,3,4])
(C) >>> import pandas as pd
(D) >>> series3 = pd.Series(array1)
(E) >>> print(series3)
2026: 24 May Shift 1
Informatics Practices
Series & DataFrames
Easy
Informatics Practices
Extracting a part of a series can be done through _____________ .
2026: 24 May Shift 1
Informatics Practices
Series & DataFrames
Easy
Informatics Practices
Match List-I with List-II
| List-I | List-II |
|---|---|
| (A) pip install pandas | (I) one-dimensional array containing a sequence of values |
| (B) Numpy array | (II) can have different data types |
| (C) Pandas DataFrame | (III) requires homogeneous data |
| (D) Series | (IV) install Pandas library |