title: How use dataframe as map to change values in another dataframe
body: <p>I have one large dataframe that acts as a map between integers and names:</p>
  
  <pre><code>from StringIO import StringIO
  import pandas as pd
  
  gene_int_map = pd.read_table(StringIO("""Gene       Int
  Mt-nd1   2
  Cers2   4
  Nampt   10
  Madd    20
  Zmiz1   21
  Syt1        26
  Syt5    30
  Syt7        32
  Cdca7   34
  Ablim2  42
  Elp5    43
  Clic1   98
  Ece2    100"""), sep="\s+")
  </code></pre>
  
  <p>Then I have another dataframe where I want to convert the <code>Gene</code> column to the ints given in the map (the names in <code>to_convert</code> can be overwritten):</p>
  
  <pre><code>to_convert = pd.read_table(StringIO("""Gene    Term
  Mt-nd1  GO:0005739
  Mt-nd1  GO:0005743
  Mt-nd1  GO:0016021
  Mt-nd1  GO:0030425
  Mt-nd1  GO:0043025
  Mt-nd1  GO:0070469
  Mt-nd1  GO:0005623
  Mt-nd1  GO:0005622
  Mt-nd1  GO:0005737
  Madd    GO:0016021
  Madd    GO:0045202
  Madd    GO:0005886
  Zmiz1   GO:0005654
  Zmiz1   GO:0043231
  Cdca7   GO:0005622
  Cdca7   GO:0005623
  Cdca7   GO:0005737
  Cdca7   GO:0005634
  Cdca7   GO:0005654"""), sep="\s+")
  </code></pre>
  
  <p>Like I said, what I'd like to do is replace the names in <code>to_convert</code> with the integer values from <code>gene_int_map</code>.</p>
  
  <p>I'm sure this is super-simple, but it seems no permutations of options for merge will do it. I could not get any boolean masks to work either.</p>
  
  <p>Ps. I'd also like to replace the values in a one-column dataframe with the integers in <code>gene_int_map</code>:</p>
  
  <pre><code>simple_series = pd.read_table(StringIO("""Gene
  Ablim2
  Elp5
  Clic1
  Ece2"""), squeeze=False)
  </code></pre>
  
  <p>It would be nice if the answer was general enough to include this case.</p>