title: Select a column in which all variable values meet the conditions in the cells
body: <p>Good day! I need help.
  I am studying pandas and I can't find the answer to my question.</p>
  <p>Let's say I have a table where the last 3 rows may contain some conditions (for example '&lt;= 0.1'):</p>
  <pre><code>t1_condition=pd. DataFrame({
  0 : [0, 1, 1, None, None, None],
  1 : [0, 0, 1, None, None, '&lt;= 0.1'],
  2 : [0, 0, 1, None, None, '&gt; 0.1'],
  3 : [0, 1, 0, '&lt;= 35', '&lt;= 2', None],
  4 : [0, 1, 0, '&lt;= 35', '&gt; 2', '&lt;= 0.1'],
  }, index=['a', 'b', 'c', 'd', 'e', 'f'])
  </code></pre>
  <p>I have specific numeric values in my input (let's say: a=0, b=1, c=0, d=20, e=3, f=0.05)
  I need to select a column in which all the values of the variables meet the conditions in the cells (in this example, column 4).
  How to choose by matching for the first three rows (a, b, c) I figured out.</p>
  <pre><code>t1_condition = t1_condition. transpose () # changing columns to rows, and rows to columns
  data_2 = t1_condition. loc[(t1_condition['a'] == a) &amp; (t1_condition ['b'] == b) &amp; (t1_condition['c'] == c)],
  
  data_2-contains the column I need (but in the form of a string, I did transpose ()).
  </code></pre>
  <p>I can't figure out how, for example, to write an algorithm for comparing the value of the variable d.
  I guess so far:<br />
  1)take each value from the string d,<br />
  2)split by a space,<br />
  3) write the if/elif/else algorithm for each case (&lt;/&gt;/&lt;=/, etc.)<br />
  4)if the condition in the cell is satisfied, change the cell value to True, otherwise-to False.<br />
  5) search the modified table by matching with a specific value as for the first three rows.</p>
  <p>Is there any more rational way to not write 1000500 lines for if/elif/else or for method description?</p>