I need to have a list containing all specific element's columns for every index. For example, this DataFrame:
>>> df
1 2 3 4 5
2016-01-27 A B B I I
2016-03-07 A C D U U
2016-04-12 H A V V V
2016-05-02 B L Y S N
2016-05-23 L N N A S
Inputting "A" I'd like to have this list as output:
[1,1,2,NaN,4]
Is there a built-in method for this?
Edit: In the original table all items in a row are unique, when editing original table to make it less "dense" to post here and I made this mistake, sorry.