Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to search pandas data frame by index value and value in any column

Tags:

I am trying to select data, read in from a file, represented by the values one and zero. I want to be able to select rows from a list of values and at the same time select for any column in which each of the selected rows has a value of one. To make it more complex I also want to select rows from a list of values where all values in a column for these rows is zero. Is this possible? Ultimately if another method besides pandas data frame would work better I would be willing to try that.

To be clear, any column may be selected and I do not know which ones ahead of time.

Thanks!