import pandas as pd
data = {
"points": [5, 6, 4],
"total": [50, 40, 20]
}
df = pd.DataFrame(data)
print(df.rmod(3))
points total 0 3 3 1 3 3 2 3 3