CBSE Class 12 Informatics Practices Question 78 of 101

Python Pandas — II — Question 2

Back to all questions
2
Question

Question 2

What are binary operations ? Name the functions that let you perform binary operations on a DataFrame.

Answer

Binary operations refer to operations that require two values to perform and these values are picked element-wise. In a binary operation involving DataFrames, the data from the two DataFrames are aligned based on their row and column indexes. For matching row and column indexes, the specified operation is performed, while for non-matching row and column indexes, NaN values are stored in the result. The functions that perform binary operations on a DataFrame include add(), radd(), sub(), rsub(), mul(), div(), and rdiv().