title: Merging a dataframe and a series on 2 columns using Pandas/Python
body: <p>I am using Python/Pandas and have dataframe (1) below. I have grouped this by ID, and then taken the max of the revision number in each group of revisions against each ID to produce series (2) below.</p>
  
  <p>I now want to merge (1) into (2) in such a way as to match the first 2 columns of (1) with the corresponding columns of (2), pulling in the other column in (2) appropriately [in the actually data set of (1), 'id', 'revision' and 'colour' are not necessarily consecutive columns, and there are other columns].</p>
  
  <p>I am essentially treating (2) as a key and pulling in appropriate data from (1).</p>
  
  <p>How do I do this using Pandas?</p>
  
  <p>Thanks in advance.</p>
  
  <p>Max.</p>
  
  <p>(1) Dataframe</p>
  
  <pre><code>ID         Revision Colour
  14446   0   red
  14446   0   red
  14446   0   red
  14466   1   red
  14466   1   red
  14466   0   red
  14466   1   red
  14466   1   red
  14466   0   red
  14466   2   red
  14466   0   red
  14466   1   red
  14466   0   red
  14471   0   green
  14471   0   green
  14471   0   green
  14471   0   green
  14473   0   blue
  14473   1   blue
  14473   0   blue
  </code></pre>
  
  <p>(2) Series</p>
  
  <pre><code>ID                   Revision
  13125                 1
  13213                 0
  13266                 0
  13276                 0
  13277                 1
  13278                 0
  13280                 2
  13285                 0
  13287                 1
  13288                 0
  13291                 1
  13292                 1
  </code></pre>