I have a pandas dataframe with the following form:
V1 V2
0 10.0 NaN
1 NaN 15.0
2 5.0 NaN
3 NaN 10.0
and I want to combine columns V1 and V2 and have the result be
V column_name
0 10.0 V1
1 15.0 V2
2 5.0 V1
3 10.0 V2
I have tried pandas.combine_first but I can't reach an optimal solution.