Q1:
2025: 15 May Shift 2
Informatics Practices
Series & DataFrames
Medium
Informatics Practices
DataFrame can be created from:
(A) series
(B) lists
(C) numpy
(D) dictionary
2025: 15 May Shift 2
Informatics Practices
Series & DataFrames
Medium
Informatics Practices
DataFrame can be created from:
(A) series
(B) lists
(C) numpy
(D) dictionary
2025: 15 May Shift 2
Informatics Practices
Series & DataFrames
Easy
Informatics Practices
To read the data from the CSV file in order to create DataFrame, ______ is the correct function. (Assume 'df' is the name of the DataFrame)
2025: 15 May Shift 2
Informatics Practices
Series & DataFrames
Easy
Informatics Practices
Identify the correct function to change the name of row label in a DataFrame.
2025: 15 May Shift 2
Informatics Practices
Series & DataFrames
Easy
Informatics Practices
Match List-I with List-II
| List-I | List-II |
|---|---|
| (A) DataFrame.values | (I) To display row labels |
| (B) DataFrame.head( ) | (II) To display all the values of the DataFrame without axes labels |
| (C) DataFrame.size | (III) To display the total values in a DataFrame |
| (D) DataFrame.index | (IV) To display the top 5 rows |
2025: 15 May Shift 2
Informatics Practices
Series & DataFrames
Easy
Informatics Practices
Arrange the following statements for creating a DataFrame:
(A) Create a DataFrame
(B) Display the DataFrame.
(C) Import the pandas library.
(D) Assign column headings.
2025: 15 May Shift 2
Informatics Practices
Series & DataFrames
Easy
Informatics Practices
________ is the command to display the last 2 rows of a DataFrame.
2025: 14 May Shift 1
Informatics Practices
Series & DataFrames
Easy
Informatics Practices
Which of the following operations can be performed on a pandas series?
(A) Mathematical operations
(B) Indexing
(C) Adding a new column
(D) Slicing
2025: 14 May Shift 1
Informatics Practices
Series & DataFrames
Easy
Informatics Practices
What will be the correct sequence of the following statements to create a series from a one-dimensional (1D) NumPy array?
(A) >>> import pandas as pd
(B) >>> s = pd.Series(a)
(C) >>> a = np.array([1,2,3,4])
(D) >>> import numpy as np
2025: 14 May Shift 1
Informatics Practices
Series & DataFrames
Easy
Informatics Practices
Arrange the following steps for concatenating two DataFrames in Pandas in correct sequence:
(A) Import pandas library
(B) Define or create the DataFrame
(C) Pass the condition as an index to the DataFrame
(D) Store or display the results
2025: 14 May Shift 1
Informatics Practices
Series & DataFrames
Easy
Informatics Practices
What does the pd.concat() operation in pandas do?
2025: 14 May Shift 1
Informatics Practices
Series & DataFrames
Easy
Informatics Practices
Arrange the following statements in proper sequence:-
(A) series1 = pd.Series(array1)
(B) import pandas as pd
(C) array1 = np. array ([1, 2, 3, 4, 5])
(D) import numpy as np
2025: 14 May Shift 1
Informatics Practices
Series & DataFrames
Easy
Informatics Practices
Match List-I with List-II
| List-I | List-II |
|---|---|
| (A) Series | (I) 1D labeled data structure |
| (B) DataFrame | (II) 2D labeled data structure |
| (C) Dictionary | (III) Key-value pair |
| (D) NumPy | (IV) Homogeneous data structure |
2025: 13 May Shift 2
Informatics Practices
Series & DataFrames
Easy
Informatics Practices
Sequence the steps to append data to an existing file and then read the entire file:
(A) Open the file in a+ mode.
(B) Use the read() method to output the contents.
(C) Use the write() or writelines() method to append data.
(D) Seek to the beginning of the file.
2025: 13 May Shift 2
Informatics Practices
Series & DataFrames
Medium
Informatics Practices
Which of the following are the correct commands to delete a column from the DataFrame 'df1'?
(A) df1=df1.drop(column name,axis=1)
(B) df1.drop(column name,axis=columns,inplace=True)
(C) df1.drop(column name,axis='columns',inplace=True)
(D) df1.drop(column name,axis=1,inplace=True)
2025: 13 May Shift 2
Informatics Practices
Series & DataFrames
Easy
Informatics Practices
Arrange the following in order in the context of exception handling:
(A) Program Termination
(B) Exception is raised
(C) Error occurs in a program
(D) Catching an exception
2025: 13 May Shift 2
Informatics Practices
Series & DataFrames
Easy
Informatics Practices
While transferring the data from a DataFrame to CSV file, if we do not want the column names to be saved to the file on the disk, the parameter to be used in to_csv() is_________.
2025: 13 May Shift 2
Informatics Practices
Series & DataFrames
Easy
Informatics Practices
Arrange the following statements to create a series from a dictionary.
(A) Print the series
(B) Import the pandas library
(C) Create the series
(D) Create a dictionary
2025: 13 May Shift 2
Informatics Practices
Series & DataFrames
Medium
Informatics Practices
Given the following DataFrame 'df':
| PNO | NAME |
|---|---|
| 111 | ROHAN |
| 222 | MEETA |
| 333 | SEEMA |
| 444 | SHALU |
| 555 | POONAM |
Select the correct commands from the following to display the last five rows:
(A) print(df.tail(-5))
(B) print(df.head(-5))
(C) print(df.tail())
(D) print(df.tail(5))
2025: 13 May Shift 2
Informatics Practices
Series & DataFrames
Easy
Informatics Practices
Sequence the given process for checking whether a string is a palindrome or not, using a deque:
(A) Load the string into the deque.
(B) Continuously remove characters from both ends.
(C) Compare the characters.
(D) Determine if the string is a palindrome based on the comparisons.
2025: 13 May Shift 2
Informatics Practices
Series & DataFrames
Easy
Informatics Practices
Which of the following is the correct command to display the top 2 records of Series 'Tail'?
2025: 13 May Shift 2
Informatics Practices
Series & DataFrames
Easy
Informatics Practices
Given the following series 'ser1':
| 0 | 69 |
|---|---|
| 1 | 80 |
| 2 | 20 |
| 3 | 50 |
| 4 | 100 |
| 5 | 70 |
State the output of the following command:
print(ser1>=70)