Arithmetic Operations 2
Explore advanced arithmetic operations in pandas such as floating and integer division, modulo, and power functions. Understand the use of reverse arithmetic methods to handle non-commutative operations and improve data manipulation skills.
We'll cover the following...
Arithmetic Operations
Having covered the basic arithmetic operations of addition, subtraction, and multiplication, let's explore the rest of the operations, which are division, modulo, and power.
Note: The details, methods, and examples explained for
add()in the earlier lesson also apply to thepandasarithmetic operations here, therefore detailed explanations won’t be repeated in this lesson.
Division—floating point and integer
There are two types of pandas methods related to the division arithmetic operation, based on whether the operation is a floating point or integer division.
Floating point division: The
div()ortruediv()(both methods give the same result)Integer division: The
floordiv()...