title: How to assign minimum value based on lookup values in two other columns in pandas?
body: <p><strong><em>Objective:</strong> Looking to programmatically match combinations in two columns to find the lowest value of another column</em></p>
  
  <p>Let's say I have this: </p>
  
  <pre><code>import pandas as pd
  
  d = {'Part_1': [91, 201, 201],
       'Part_2': [201,111,91], 
       'Result': [3,3, 3], 
       'Sub-Score': [0.60, 0.8,0.9], 
       'Final-Score': [0,0,0]}
  df = pd.DataFrame(data=d)
  df
  </code></pre>
  
  <p>I want to to find the minimum value from the sub-score column that can be assigned to the Final-Score column. I need to choose based on matching Part_1 and Part_2 (which can be in different positions for either part):</p>
  
  <pre><code>d_new = {'Part_1': [91, 201, 201],
           'Part_2': [201,111,91], 
           'Result': [3,3, 3], 
           'Sub-Score': [0.60, 0.8,0.9], 
           'Final-Score': [0.6,.8,.6]}
  df_new = pd.DataFrame(data=d_new)
  df_new
  </code></pre>
  
  <p>Here we can see that <strong>row 0</strong> and <strong>row 2</strong> have the <em>same values</em> in columns <strong>Part_1</strong> and <strong>Part_2</strong>, they are simply out of order. Further, we can see <strong>row 0</strong> has a Sub-Score value of 0.60 and <strong>row 2</strong> has a Sub-Score value of 0.9. </p>
  
  <p>I am looking to assign the Sub-Score value from <strong>row 0</strong> (since it is the lowest of <strong>row 0</strong> and <strong>row 2</strong>) to the column Final-Score for both row 0 and <strong>row 2</strong>. <strong>Row 1</strong> has nothing to compare to and does not have the same parts as <strong>row 0</strong> and <strong>row 2</strong>, so we carry over its Sub-score value to the Final-Score value.</p>
  
  <p>Any help would be appreciated.</p>
  
  <p><strong>(Edited):</strong></p>
  
  <p>Input:</p>
  
  <pre><code>   Final-Score  Part_1  Part_2  Result  Sub-Score
  0            0      91     201       3        0.6
  1            0     201     111       3        0.8
  2            0     201      91       3        0.9
  </code></pre>
  
  <p>Desired output:</p>
  
  <pre><code>   Final-Score  Part_1  Part_2  Result  Sub-Score
  0          0.6      91     201       3        0.6
  1          0.8     201     111       3        0.8
  2          0.6     201      91       3        0.9
  </code></pre>