Informatics Practices
To subtract the values of two DataFrames, …………… function may be used.
- sub
- difference
- minus
- rsub
Python Pandas
3 Likes
Answer
sub, rsub
Reason — We can subtract two DataFrame objects using either (-) operator or using sub() function as per syntax : <DF1>.sub(<DF2>) which means <DF1>-<DF2> or by using rsub() function i.e., reverse subtract as per syntax : <DF1>.rsub(<DF2>) which means <DF2>-<DF1>.
Answered By
1 Like
Related Questions
To iterate over vertical subsets of a DataFrame, …………… function may be used.
- iterate()
- iterrows()
- itercols()
- iteritems()
To add two DataFrames' values, …………… function may be used.
- plus
- rplus
- add
- radd
To divide the values of two DataFrames, …………… function may be used.
- divide
- div
- rdiv
- division
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)