Informatics Practices
Which of the following would give the same output as DF/DF1 where DF and DF1 are DataFrames ?
- DF.div(DF1)
- DF1.div(DF)
- Divide(DF, DF1)
- 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
To subtract the values of two DataFrames, …………… function may be used.
- sub
- difference
- minus
- rsub
To divide the values of two DataFrames, …………… function may be used.
- divide
- div
- rdiv
- division
To skip NaN values in a calculation, you can specify …………… attribute.
- NaN
- NA
- skipna
- all of these
Which of the following is not a valid function that can be used with DataFrames ?
- count()
- sum()
- length()
- mad()