I\'m giving a toy example but it will help me understand what\'s going on for something else I\'m trying to do. Let\'s say I want a new column in a dataframe \'optimal_fruit
You can get all the values of the row as a list using the np.array() function inside your list of comprehension.
The following code solves your problem:
df2['optimal_fruit'] = [x[0] * x[1] - x[2] for x in np.array(df2)]
It is going to avoid the need of typing each column name in your list of comprehension.