Pandas Library MCQs | Learn Python Programming Step by Step | Python Libraries MCQs

Published: 08 January 2023
on channel: Arihant Online Academy
260
12

Most important multiple choice questions for Pandas Library in Python Programming.

#pandaslibrary #pandas #pythonprogramming #pandaslibrarymcqs #pythontutorial

What is the function to read a CSV file into a pandas DataFrame?
A) read_csv()
B) import_csv()
C) load_csv()
D) pandas.csv_read()

Solution: Watch the session

How do you select a column in a pandas DataFrame?
A) df['column_name']
B) df.column_name
C) df.get_column('column_name')
D) df[:, 'column_name']

Solution: Watch the session

How do you select a row in a pandas DataFrame by its index label?
A) df.loc['index_label']
B) df['index_label']
C) df[index_label]
D) df.iloc['index_label']
Solution: Watch the session

How do you drop a row in a pandas DataFrame by its index label?
A) df.drop(index_label)
B) df.remove(index_label)
C) df.delete(index_label)
D) df.pop(index_label)

Solution: Watch the session

How do you fill missing values in a pandas DataFrame with the mean of the column?
A) df.fillna(mean)
B) df.impute(mean)
C) df.interpolate(mean)
D) df.fillna(df.mean())

Solution: Watch the session

What is pandas primarily used for in Python?
a) Data visualization
b) Data manipulation and analysis
c) Machine learning
d) Web scraping
Answer: Watch the session

Which of the following is NOT a data structure in pandas?
a) Series
b) DataFrame
c) Dictionary
d) Panel
Answer: Watch the session

How would you select the second row of a DataFrame object in pandas?
a) df.iloc[1]
b) df.loc[1]
c) df[1]
d) df[1,:]
Answer: Watch the session

What is the output of the following code?

import pandas as pd df = pd.DataFrame({'A': [1, 2, 3], 'B': [4, 5, 6], 'C': [7, 8, 9]}) df.loc[df['A'] greater than symbol 1, 'B']
Copy code
a) `4` b) `5` c) `[4, 5, 6]` d) `[5, 6]` Answer: Watch the session

Which of the following is NOT a valid way to create a Series object in pandas?
a) pd.Series([1, 2, 3])
b) pd.Series(data=[1, 2, 3])
c) pd.Series(1, 2, 3)
d) pd.Series({'a': 1, 'b': 2, 'c': 3})
Answer: Watch the session

Join our Telegram group for access thousands of FREE pdf: https://t.me/arihantonlineacademy

For daily lectures and FREE study, content Subscribe to us on Youtube:    / arihantonlineacademy  

For regular technical updates connect with us on Linkedin:   / imrahuljain  

For our genuine feedback, kindly visit, rate us & comment on your reviews: https://goo.gl/maps/MXEZuCgRgYq9RRcHA

Let's get social with us:   / professorrahuljain  


Watch video Pandas Library MCQs | Learn Python Programming Step by Step | Python Libraries MCQs online without registration, duration hours minute second in high quality. This video was added by user Arihant Online Academy 08 January 2023, don't forget to share it with your friends and acquaintances, it has been viewed on our site 26 once and liked it 1 people.