Examples
import numpy as np
import pandas as pd
df = pd.DataFrame({'angles': [0, 3, 4],
'degrees': [360, 180, 360]},
index=['ellipse', 'right triangle', 'rhombus'])
df
df.mod
df_multindex = pd.DataFrame({'angles': [0, 3, 4, 5, 6],
'degrees': [360, 180, 360, 540, 720]},
index=[['X', 'X', 'X', 'Y', 'Y'],
['ellipse', 'right triangle', 'rhombus',
'pentagon', 'hexagon']])
df_multindex
df.mod(df_multindex, level=1, fill_value=0)