1. Home
  2. Data Science
  3. Pandas
  4. In df.apply(func, axis=1), what does func receive on each…

Added 30 Nov -0001

In df.apply(func, axis=1), what does func receive on each call?

  1. One row as a Series Correct answer
  2. One column as a Series
  3. The whole DataFrame
  4. A single scalar cell

Correct answer

A. One row as a Series

14 views

MCQSEXAM

Explanation

With axis=1, pandas passes each row as a Series whose index holds the column labels.

Reference

Asked in: NTS, PPSC IT, Interviews

Preparing for an exam?

Doubts & discussion

Not sure why the answer is A? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Pandas MCQs

Practise all Pandas MCQs

Similar MCQs