Here is a question I have regarding my project.
Let's say that I have this dataset.
X1 X2 X3 X4
1 1 2 1 3
2 1 3 2 1
3 1 3 4 2
4 1 1 2 3
5 3 4 3 2
6 2 1 3 4
From this dataset, I would like to be able to specify any random row and find out the column names where the cell is equal to 1. For example, if I were to specify the 1st row, then I would get X1 and X3 as my output. Likewise, if I were to specify the 2nd row, then I would get X1 and X4 as my output. If I were to specify the 3rd row, then I would get X1 as my output.
I hope these examples make sense. I have looked around on StackOverflow but I was not able to find what I was looking for. I would really appreciate it if you could help me with this problem.