Skip to content
Advertisement

return index of matching value over columns in dataframe

my input:

JavaScript

I trying get over df all range where matching value is true.
My code:

JavaScript

What I get:*

[2, 3, 4, 5]

So its correct, but how to get all index over each column in df? In other word, I dont want input manually name of column to get index matching value, but get ouptut per column.
So what I expect:

[2,3,4,5] [0,1,2,3]

so for example two lists(or more) each for its own column. There might be a better way to find matches and get the index?

Advertisement

Answer

Try the following,

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement