Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

Which of the following attributes or arguments are used to set column names of a data frame?

Answer»

Which of the following ATTRIBUTES or arguments are used to set COLUMN NAMES of a data frame?
Choose the correct option from below option
(1)index
(2)columns
(3)indexes
(4)column

Answer:-(2)columns

2.

Which of the following is not a Data Structure of Pandas?

Answer»

Which of the following is not a Data Structure of Pandas?
Choose the CORRECT option from below option
(1)SERIES
(2)PANEL
(3)Dictionary
(4)Data Frame

Answer:-(3)Dictionary

3.

Which of the following expressions are used to check if each element of a series s is present in the list of elements [67, 32].

Answer»

Which of the following EXPRESSIONS are used to check if each element of a series s is present in the LIST of elements [67, 32].
Series s is defined as SHOWN below.
s = pd.Series([99, 32, 67],list('abc'))
Choose the correct OPTION from below option
(1)s.isin([67, 32])
(2)[67, 32] in s
(3)s in [67, 32]
(4)[67, 32] isin s

Answer:-(1)s.isin([67, 32])

4.

What is the data type of series s defined in below code?

Answer»

What is the data TYPE of SERIES s defined in below CODE?
import pandas as pd
s = pd.Series([9.2, 'hello', 89])
Choose the correct option from below option
(1)int
(2)str
(3)OBJECT
(4)float

Answer:-(3)object

5.

Which of the following cannot be used to create a Data frame?

Answer»

Which of the following cannot be USED to create a Data frame?
Choose the correct OPTION from below option
(1)A tuple of tuples
(2)A dictionary of lists
(3)A dictionary of tuples
(4)A list of lists

Answer:-(1)A tuple of tuples

6.

Which of the following argument is used to label the elements of a series?

Answer»

Which of the following argument is USED to label the elements of a SERIES?
Choose the correct OPTION from below option
(1)elements
(2)VALUES
(3)index
(4)labels

Answer:-(3)index

7.

How to read JSON file from Pandas in python?

Answer»

How to read JSON FILE from Pandas in python?
As we knows Big data sets are often extracted and stored as JSON. JSON is the plain text but have some FORMAT of OBJECT. Below is the syntax to read data from JSON file

import pandas as pdobj
DF=pdobj.read_json('data.json')
print(df.tostring())

In above code to_string() will print all the data in DATAFRAME(df)

8.

What is the output of the expression "b" in s, where s is the series defined as shown below?

Answer»

What is the OUTPUT of the expression "b" in s, where s is the series DEFINED as shown below?
s = pd.Series([89.2, 76.4, 98.2, 75.9], index=list('abcd'))
Choose the correct option from below list
(1)False
(2)True
(3)Error
(4)None of the options

Answer:-(2)True