Pandas MCQs with answers Page - 17

Here, you will find a collection of MCQ questions on Pandas. Go through these questions to enhance your preparation for upcoming examinations and interviews.

To check the correct answer, simply click the View Answer button provided for each question.

Have your own questions to contribute? Click the button below to share your MCQs with others!

+ Add Question

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. Which method is used to count non-null values in a DataFrame?

  • (A) count()
  • (B) sum()
  • (C) size()
  • (D) value_counts()

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. Which pandas method is used to apply a function element-wise on a Series?

  • (A) map()
  • (B) apply()
  • (C) transform()
  • (D) aggregate()

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. Which method is used to replace multiple values in a DataFrame at once?

  • (A) fillna()
  • (B) replace()
  • (C) update()
  • (D) substitute()

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. Which pandas function is used to read data from an Excel file?

  • (A) read_csv()
  • (B) read_excel()
  • (C) read_table()
  • (D) read_json()

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. Which pandas method is used to change column names in-place?

  • (A) columns()
  • (B) rename(columns=..., inplace=True)
  • (C) set_columns()
  • (D) update_columns()

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. Which pandas method returns the cumulative sum over a DataFrame or Series?

  • (A) cumsum()
  • (B) sum()
  • (C) cumprod()
  • (D) cummulative()

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. Which method is used to get the maximum value of each column in a DataFrame?

  • (A) max()
  • (B) min()
  • (C) sum()
  • (D) mean()

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. Which method returns the first non-null value in each column?

  • (A) first()
  • (B) first_valid_index()
  • (C) bfill()
  • (D) ffill()

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. Which pandas method is used to create dummy/indicator variables?

  • (A) get_dummies()
  • (B) dummy_vars()
  • (C) to_categorical()
  • (D) one_hot()

S

Shyam Dubey • 3.70K Points
Extraordinary

Q. Which method is used to drop a level from a MultiIndex in pandas?

  • (A) unstack()
  • (B) stack()
  • (C) droplevel()
  • (D) remove_level()

Add MCQ in this Category

If you want to share an MCQ question in this category, it's a great idea! It will be helpful for many other students using this website.

Share Your MCQ