0% found this document useful (0 votes)
27 views6 pages

364-C-2901-Assignment IP202 Multiple Choice Questions

The document contains multiple choice questions about Pandas in Python. It tests knowledge of Pandas concepts like how to create and access DataFrames and Series, handling missing data, merging, grouping, plotting and reading/writing data.

Uploaded by

panda0001a
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views6 pages

364-C-2901-Assignment IP202 Multiple Choice Questions

The document contains multiple choice questions about Pandas in Python. It tests knowledge of Pandas concepts like how to create and access DataFrames and Series, handling missing data, merging, grouping, plotting and reading/writing data.

Uploaded by

panda0001a
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

BCM Arya Model SR.

Sec School, Shastri Nagar


Assignment -IP202- Multiple Choice Questions
Chapter- Python Pandas

Part-A

What is Pandas in Python?

A. A module for working with numerical data

B. A module for working with time-series data

C. A module for working with structured data

D. A module for working with unstructured data

Answer: C

Which of the following is a valid way to create a Pandas Series?

A. s = [1, 2, 3]

B. s = pd.Series([1, 2, 3])

C. s = np.Series([1, 2, 3])

D. s = pd.DataFrame([1, 2, 3])

Answer: B

How do you access a specific element in a Pandas DataFrame?

A. Using iloc

B. Using loc

C. Using ix

D. All of the above

Answer: D

Which method is used to remove missing values in Pandas?

A. drop()

B. fillna()
C. replace()

D. None of the above

Answer: A

What is the difference between the merge() and join() methods in Pandas?

A. There is no difference, they are synonyms

B. merge() is used for combining two DataFrames based on common columns, while join() is used for
combining two DataFrames based on common indices

C. join() is used for combining two DataFrames based on common columns, while merge() is used for
combining two DataFrames based on common indices

D. merge() is used for sorting DataFrames, while join() is used for filtering DataFrames

Answer: B

Which of the following is used to group data in Pandas?

A. groupby()

B. merge()

C. sort_values()

D. fillna()

Answer: A

Which of the following is used to plot data in Pandas?

A. matplotlib

B. seaborn

C. plotly

D. All of the above

Answer: D

How do you read data from a CSV file in Pandas?

A. pd.read_csv()

B. pd.read_excel()

C. pd.read_json()

D. pd.read_sql()
Answer: A

Which of the following is not a valid way to select columns in a Pandas DataFrame?

A. df['column_name']

B. df.column_name

C. df.loc[:, 'column_name']

D. df.iloc[:, column_index]

Answer: B

What is the difference between loc and iloc in Pandas?

A. loc is used for label-based indexing, while iloc is used for integer-based indexing

B. iloc is used for label-based indexing, while loc is used for integer-based indexing

C. loc is used for filtering rows, while iloc is used for filtering columns

D. iloc is used for filtering rows, while loc is used for filtering columns

Answer: A

Which of the following is a Pandas data structure for one-dimensional labeled data?

a) DataFrame

b) Series

c) Array

d) Tuple

Answer: b) Series

Which of the following is not a method for creating a Pandas Series?

a) pd.Series()

b) pd.array()

c) pd.DataFrame()

d) pd.read_csv()

Answer: b) pd.array()

How can you access the first element of a Pandas Series?


a) series[0]

b) series.iloc[0]

c) series.loc[0]

d) All of the above

Answer: d) All of the above

Which method can you use to drop missing values from a Pandas Series?

a) drop_missing()

b) dropna()

c) remove_na()

d) None of the above

Answer: b) dropna()

Which method can you use to sort a Pandas Series in ascending order?

a) sort_index()

b) sort_values()

c) sort()

d) None of the above

Answer: b) sort_values()

Which of the following is a method for merging Pandas DataFrames?

a) pd.concat()

b) pd.join()

c) pd.merge()

d) All of the above

Answer: d) All of the above

How can you group data in a Pandas DataFrame?

a) df.group_by()

b) df.group()

c) df.groupby()
d) None of the above

Answer: c) df.groupby()

Which method can you use to reshape a Pandas DataFrame?

a) melt()

b) pivot()

c) stack()

d) All of the above

Answer: d) All of the above

Which method can you use to read a CSV file into a Pandas DataFrame?

a) pd.read_csv()

b) pd.read_excel()

c) pd.read_json()

d) None of the above

Answer: a) pd.read_csv()

Which of the following is not a way to handle missing data in Pandas?

a) Removing missing data using dropna()

b) Filling missing data using fillna()

c) Interpolating missing data using interpolate()

d) Converting missing data to a string using to_string()

Answer: d) Converting missing data to a string using to_string()


Compiled by: Mrs Ambica Soni

Verified by: Mrs. Vandana Bandhari

You might also like