title: How to filter a dataframe using partial matches from another dataframe
body: <p>I have two dataframe and I want to use one of the dataframes to filter the other and make a new dataframe. The two dataframes have a column with similar information but it is not an exact match. I have been trying to use <code>str.contains</code> but so far I keep getting <code>TypeError: 'Series' objects are mutable, thus they cannot be hashed</code> when I try. Here is a sample of my dataframes and the code I have tried.</p>
  
  <pre><code>promoter = pd.read_csv('promoter_coordinate.csv')
  print(promoter.head())
  
  AssociatedGeneName            B      C    D E                                   F
              plexB_1  NC_004353.3  64381  - Drosophila melanogaster (Fruit fly)  region 
                 ci_1  NC_004353.3  76925  - Drosophila melanogaster (Fruit fly)  region   
               RS3A_1  NC_004353.3  87829  - Drosophila melanogaster (Fruit fly)  region   
                pan_1  NC_004353.3  89986  + Drosophila melanogaster (Fruit fly)  region  
                pan_2  NC_004353.3  90281  + Drosophila melanogaster (Fruit fly)  region   
  
  data = pd.read_csv('FBgn with gene name.csv')
  print(data.head())
  Gene AssociatedGeneName   FBgn Number     timepoint
  CG10002        fkh        FBgn0000659          2   
  CG10002        fkh        FBgn0000659          2   
  CG10002        fkh        FBgn0000659          2   
  CG10002        fkh        FBgn0000659          2   
  CG10006    CG10006        FBgn0036461          2   
  
  x = promoter[promoter['AssociatedGeneName'].str.contains(data['AssociatedGeneName'])]
  </code></pre>
  
  <p>The heads of both list don't have a match but basically the ideal outcome would be something similar to the following, where the two columns that are named 'AssociatedGeneName' would be compared. </p>
  
  <pre><code>AssociatedGeneName            B      C    D  E                                    F    
               fkh_1  NT_033777.2  24410805 -  Drosophila melanogaster (Fruit fly)  region
  </code></pre>
  
  <p>Essentially I want a dataframe with all of the values in <code>promoter</code> that have a partial match to the values in <code>data['AssociatedGeneName']</code> If someone could point me the right direction I would be grateful. I am relatively new to coding, I have been using python and pandas and would prefer to keep using python to solve this problem. Here is the error I keep getting.  </p>
  
  <pre><code>x = promoter[promoter['AssociatedGeneName'].str.contains(data['AssociatedGeneName'])]
  
  Traceback (most recent call last):
    File "&lt;pyshell#15&gt;", line 1, in &lt;module&gt;
      x = promoter[promoter['AssociatedGeneName'].str.contains(data['Associated Gene Name'])]
    File "C:\Python34\lib\site-packages\pandas\core\strings.py", line 1226, in contains
  na=na, regex=regex)
    File "C:\Python34\lib\site-packages\pandas\core\strings.py", line 203, in str_contains
  regex = re.compile(pat, flags=flags)
    File "C:\Python34\lib\re.py", line 219, in compile
  return _compile(pattern, flags)
    File "C:\Python34\lib\re.py", line 278, in _compile
  return _cache[type(pattern), pattern, flags]
    File "C:\Python34\lib\site-packages\pandas\core\generic.py", line 663, in __hash__
      ' hashed'.format(self.__class__.__name__))
  TypeError: 'Series' objects are mutable, thus they cannot be hashed
  </code></pre>