title: How to add column information to a Pandas dataframe referring to other rows
body: <p>I am looking to add information to a dataframe referencing other rows in the dataframe. The dataframe has pairs of scientific nomenclature, going in the ranking hierarchy (species-genus pairs, genus-family pairs and so on). I need to have the taxrank for both the source and target pairs in the same row. I have the target taxrank on the row, but need to search for where the source cell is a target to pull out the appropriate taxrank and add it as a taxrank column. Below is an example of what I have so far:</p>
  
  <pre><code>TAXRANK_target  target  source
  45139    order   Salmoniformes   Protacanthopterygii
  45140    family  Salmonidae  Salmoniformes
  45201    genus   Salmo   Salmonidae
  45202    species    labrax   Salmo
  45203    species    carpio   Salmo
  45204    species    trutta   Salmo
  45205    species    letnica  Salmo
  45206    species    marmoratus   Salmo
  45207    species    fibreni  Salmo
  </code></pre>
  
  <p>And what I want it to look like:</p>
  
  <pre><code>TAXRANK_target  target  source  TAXRANK_source
  45139    order   Salmoniformes   Protacanthopterygii    NaN
  45140    family  Salmonidae  Salmoniformes  order
  45201    genus   Salmo   Salmonidae family
  45202    species    labrax   Salmo  genus
  45203    species    carpio   Salmo  genus
  45204    species    trutta   Salmo  genus
  45205    species    letnica  Salmo  genus
  45206    species    marmoratus   Salmo  genus
  45207    species    fibreni  Salmo  genus
  45208    species    obtusirostris    Salmo  genus
  </code></pre>
  
  <p>What I cannot figure out is how to deliberately reference one row to impact on a different row.</p>