KnowledgeBoat Logo
|

Informatics Practices

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)

Python Pandas

1 Like

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.

Answered By

1 Like


Related Questions