I have a dataframe as below:
I want to get the name of the column if column of a particular row if it contains 1 in the that column.
e.g.
For Ro
Use DataFrame.dot:
df1 = df.dot(df.columns)
If there is multiple 1 per row:
1
df2 = df.dot(df.columns + ';').str.rstrip(';')