I have a pandas dataframe with this structure:
df_test
V | A | B | C | D
-10 | nan | nan | nan | nan
-9.9 | 10 | 1 | -2200 | 100
-9.8 | 11 | 2 | -2211 | 1
I would like to add a new column minimum_difference containing the column name with the smallest absolute value for that specific row (ignoring V), like this:
V | A | B | C | D | minimum_difference
-10 | nan | nan | nan | nan | nan
-9.9 | 10 | 1 | -2200 | 100 | B
-9.8 | 11 | 2 | -2211 | 1 | D