I have a dataset that looks like this:
+------+---+----+-----+---+---+-------+
| Name | A | B | ... | X | Y | maxXY |
+------+---+----+-----+---+---+-------+
| John | 3 | 6 | | 3 | 1 | |
+------+---+----+-----+---+---+-------+
| Will | 2 | 3 | | 4 | 4 | |
+------+---+----+-----+---+---+-------+
| Dave | 2 | 7 | | 3 | 2 | |
+------+---+----+-----+---+---+-------+
| Pete | 1 | 21 | | 2 | 3 | |
+------+---+----+-----+---+---+-------+
I would like to calculate the row-wise maximum value from a selection of columns which I would reference using the column id. So something like this:
target_columns = [45,46] # X = 45, Y = 46
dataframe['maxXY'] = ...
Many thanks,