0
I have a dataframe with several columns, the last two are where I sum and multiply the other columns, at the end I create a column that should select the highest value between these two columns, for example:
I ended up doing a 'FOR' to go through each line, but as it is a large dataframe, it ends up taking a long time.
Is there any other way to do it?
Try this:
df['soma_final'] = df.loc[:, ['soma1', 'soma2']].max(1)
– Terry