use operations like max/min within a row to a dataframe 'd' in pandas,"d.apply(lambda row: min([row['A'], row['B']]) - row['C'], axis=1)"