title: pandas df: add column if doesn't exist, add values to new column from dict
body: <p>I am new to pandas but I'm trying to create a large dataframe where I organize information about lots of sequences by their sequence IDs (Seq_ID) and add information about the sequences to the dataframe. 
  Currently the df looks something like this:</p>
  
  <pre><code>     Seq_ID        mol_type
  0 4_cDNA_v              RNA
  1 2_133+_v              RNA
  2 5_BM4D_g              RNA
  .                         .
  .                         .
  1301 4_PB_g             RNA
  </code></pre>
  
  <p>I want to write a function that looks at my current df, source_df, and if the column 'Seq_source' does not exist, it adds it. 
  Then to fill in the column 'Seq_Source', I have a series of key:value pairs called cell_type. I want to search the Seq_ID column to see if any of the values are found in the Seq_ID, and if so, add the key in its corresponding row in the new column, 'Seq_Source' so that it looks like the following:</p>
  
  <pre><code>     Seq_ID    mol_type    Seq_Source
  0 4_cDNA_v          RNA            PB
  1 2_133+_v          RNA          HSPC
  2 5_BM4D_g          RNA          BMMC
  .                     
  .                     
  1301 4_CD4_g        RNA          PBMC
  </code></pre>
  
  <p>I wrote some pseudocode to help explain my thinking about an approach.</p>
  
  <pre><code>cell_type = {
      'PBMC':['CD4','NK', 'CD8'],
      'HSPC': ['133+', '133+F'],
      'PB': ['cDNA', 'cDNAA', 'cDNAB', 'cDNAC'],
      'BMMC':['cDNABM', '34D_Vc','BM4_Vs', 'BM4_Vc', 'BM4n_Vs']
          }
  
  
  def find_cell_source(dictionary, df, reference, new_header):
      '''
      takes in a dictionary where key corresponds to list of values.
      If new_header does not exist, the new column is created.
      If a value from key:value pair is found within any of the string entries under reference column
      in the database, key is added to reference row under new_header.
      '''
  
      # add new_header if does not exist
      df[new_header] = [df[new_header] if new_header not in df]
  
      # read rows of reference column and see if values from dict is in references
      # add key to row under new_header if it exists, pass if it doesn't
  
      for i in df['reference']:
          for k,v in dictionary:
              for j in v:
                  if j in i:
                      df['new_header'] = k
                  else:
                      pass
      return df
  
  
  find_cell_source(cell_type, source_df, 'Seq_ID', 'Seq_Source')
  </code></pre>