Python | Pandas dataframe.rmul()
Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier.
Pandas dataframe.rmul() function is used for finding the multiplication of dataframe and other, element-wise (binary operator rfloordiv). This function is essentially same as doing other * dataframe but with a support to substitute for missing data in one of the inputs.
Syntax:DataFrame.rmul(other, axis=’columns’, level=None, fill_value=None)
other : Series, DataFrame, or constant
axis : For Series input, axis to match Series index on
level : Broadcast across a level, matching Index values on the passed MultiIndex level
fill_value : Fill existing missing (NaN) values, and any new element needed for successful DataFrame alignment, with this value before computation. If data in both corresponding DataFrame locations is missing the result will be missing
Returns : result : DataFrame
Example #1: Use rmul() function to find the multiplication of a series with a dataframe.
Let’s create the series
Lets use the dataframe.rmul() function to find the multiplication of a series with dataframe
Example #2: Use rmul() function to perform multiplication of a dataframe with other.
Lets perform df2 * df1
Please Login to comment...