CBSE Class 12 Informatics Practices Question 30 of 101

Python Pandas — II — Question 6

Back to all questions
6
Question

Question 6

Which of the following would give the same output as DF/DF1 where DF and DF1 are DataFrames ?

  1. DF.div(DF1)
  2. DF1.div(DF)
  3. Divide(DF, DF1)
  4. Div(DF, DF1)
Answer

DF.div(DF1)

Reason — The div() function with the syntax <DF>.div(<DF1>), performs element-wise division between DF and DF1, which is equivalent to <DF>/<DF1> in terms of functionality and output.