Examples

In [1]:
import numpy as np
import pandas as pd
In [2]:
df = pd.DataFrame({'angles': [0, 3, 4],
                   'degrees': [360, 180, 360]},
                  index=['ellipse', 'right triangle', 'rhombus'])
df
Out[2]:
angles degrees
ellipse 0 360
right triangle 3 180
rhombus 4 360

Multiply a DataFrame of different shape with operator version:

In [3]:
other = pd.DataFrame({'angles': [0, 3, 4]},
                     index=['ellipse', 'right triangle', 'rhombus'])
other
Out[3]:
angles
ellipse 0
right triangle 3
rhombus 4
In [4]:
df * other
Out[4]:
angles degrees
ellipse 0 NaN
right triangle 9 NaN
rhombus 16 NaN
In [5]:
df.mul(other, fill_value=0)
Out[5]:
angles degrees
ellipse 0 0.0
right triangle 9 0.0
rhombus 16 0.0