title: Pandas: Add new column based on comparison of two DFs
body: <p>I have 2 dataframes that I am wanting to compare one to the other and add a 'True/False' to a new column in the first based on the comparison. </p>
  
  <p>My data resembles:</p>
  
  <p>DF1:</p>
  
  <pre><code>        cat  sub-cat    low       high
  3       3        1      208       223
  4       3        1      224       350
  8       4        1      223       244
  9       4        1      245       350
  13      5        1      232       252
  14      5        1      253       350
  </code></pre>
  
  <p>DF2:</p>
  
  <pre><code>      Cat   Sub-Cat   Rating
  0     5      1           246
  1     5      2           239
  2     8      1           203
  3     8      2           218
  4     K      1           149
  5     K      2           165
  6     K      1           171
  7     K      2           185
  8     K      1           157
  9     K      2           171
  </code></pre>
  
  <p>Desired result would be for DF2 to have an additional column with a True or False depending on if, based on the cat and sub-cat, that the rating is between the low.min() and high.max() or Null if no matches found to compare.</p>
  
  <p>Have been running rounds with this for far too long with no results to speak of.</p>
  
  <p>Thank you in advance for any assistance.</p>
  
  <p>Update:</p>
  
  <p>First row would look something like:</p>
  
  <pre><code>      Cat   Sub-Cat   Rating  In-Spec
  0     5      1           246    True
  </code></pre>
  
  <p>As it falls within the min low and the max high.</p>
  
  <p>Example: There are two rows in DF1 for cat = 5 and sub-cat = 2. I need to get the minimum low and the maximum high from those 2 rows and then check if the rating from row 0 in DF2 falls within the minimum low and maximum high from the two matching rows in DF1</p>