Examples
import numpy as np import pandas as pd
x = pd.Series([2, 2, 2, np.nan], index=['p', 'q', 'r', 's']) x
p 2.0 q 2.0 r 2.0 s NaN dtype: float64
y = pd.Series([1, 1, 1, np.nan], index=['p', 'q', 's', 't']) y
p 1.0 q 1.0 s 1.0 t NaN dtype: float64
x.mod(y, fill_value=0)
p 0.0 q 0.0 r NaN s 0.0 t NaN dtype: float64