Pandas MCQs with answers Page - 10

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

A

Admin • 833.24K Points
Coach

Q. Which method allows iteration over DataFrame rows as (index, Series)?

  • (A) df.itercols()
  • (B) df.itertuples()
  • (C) df.iterrows()
  • (D) df.rowiter()

A

Admin • 833.24K Points
Coach

Q. What will `df[['A', 'B']].mean()` do?

  • (A) Return mean of each column
  • (B) Return total of each column
  • (C) Return rows with mean values
  • (D) Return standard deviation

A

Admin • 833.24K Points
Coach

Q. What does `dropna(axis=1)` do?

  • (A) Removes rows with NaN
  • (B) Removes columns with NaN
  • (C) Fills NaN values
  • (D) Sorts the columns

A

Admin • 833.24K Points
Coach

Q. Which of the following is used to get the rolling average?

  • (A) df['col'].rolling(window=3).mean()
  • (B) df['col'].moving_avg(3)
  • (C) df['col'].average(3)
  • (D) df['col'].roll_mean(3)

A

Admin • 833.24K Points
Coach

Q. Which method combines two DataFrames column-wise?

  • (A) concat(axis=0)
  • (B) concat(axis=1)
  • (C) merge()
  • (D) groupby()

A

Admin • 833.24K Points
Coach

Q. Which function is used to randomly shuffle rows?

  • (A) df.shuffle()
  • (B) df.sample(frac=1)
  • (C) df.random()
  • (D) df.mix()

A

Admin • 833.24K Points
Coach

Q. Which method finds the absolute values of numeric columns?

  • (A) df.abs()
  • (B) df.absolute()
  • (C) df.positive()
  • (D) df.val()

A

Admin • 833.24K Points
Coach

Q. Which method creates a pivot table?

  • (A) pivot_table()
  • (B) pivot()
  • (C) pivot_data()
  • (D) melt()

A

Admin • 833.24K Points
Coach

Q. What will `df.empty` return?

  • (A) True if DataFrame has only NaN values
  • (B) True if DataFrame has no rows and columns
  • (C) False always
  • (D) Length of DataFrame

A

Admin • 833.24K Points
Coach

Q. Which function reads SQL data into a DataFrame?

  • (A) read_sql_table()
  • (B) read_sql()
  • (C) open_sql()
  • (D) sql()

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