I have a python data frame like this
ID ID_1 ID_2 ID_3 ID_4 ID_5
ID_1 1.0 20.1 31.0 23.1 31.5
ID_2 3.0 1.0 23.0 90.0 21.5
ID_3. 7.0 70.1 1.0 23.0 31.5
ID_4. 9.0 90.1 43.0 1.0 61.5
ID_5 11.0 10.1 11.0 23.0 1.0
I need to update values where COLUMN NAMES are equal to the ID values and then set the values to zero.
for example in the first row the ID value (ID_1) matches with first column ID_1 and I need to reset the value of 1.0 to zero , and similarly for second row , the ID value (ID_2) matches with second column ID_2 and reset the value of 1.0 to zero.
How do I do this in Python ? I am very new in python. Can anyone please help.
the expected output would be like this -
ID ID_1 ID_2 ID_3 ID_4 ID_5
ID_1 0.0 20.1 31.0 23.1 31.5
ID_2 3.0 0.0 23.0 90.0 21.5
ID_3. 7.0 70.1 0.0 23.0 31.5
ID_4. 9.0 90.1 43.0 0.0 61.5
ID_5 11.0 10.1 11.0 23.0 0.0