How to apply nested for loop within a lambda.apply function to iterate over columns within dataframe, expected output in the image below
import pandas as pd from