do you know how if there is a better way to perform this task without using for loop?
Starting with the following dataset:
import pandas as pd df = pd.