I would like to apply a lambda function to several columns but I am not sure how to loop through the columns. Basically I have Column1 - Column50 and I want the exact same thing to happen on each but can't figure out how to iterate through them where x.column is below. Is there a way to do this?
for column in df:
df[column] = df.apply(lambda x: x.datacolumn * x.datacolumn2 if x.column >= x.datacolumn3, axis=1)