title: Partial Map with a dictionary in Pandas (python), Return attributes error
body: <p>The following is a sub-set of a dictionary: </p>
  
  <pre><code>equiv= {'Urin problem': 'C0/ Urine', 'disorientation': 'C0233407 / Disorientation', 'fatigue': 'C0015672 / Fatigue', 'headache': 'C334 / headache'} 
  </code></pre>
  
  <p>I am going to map the following data to this dictionary: </p>
  
  <pre><code>drug_id       WD
  lexapro.1   minor urin problem
  lexapro.1   Fatigue
  lexapro.1   disorientation
  lexapro.1   tiredness
  lexapro.14  dizziness
  lexapro.14  headaches
  </code></pre>
  
  <p>The output should be like this:</p>
  
  <pre><code>drug_id        WD                           Map              Exact_Match
  
  lexapro.1   minor urin problem      C0/ Urine       
  lexapro.1   Fatigue                'C0015672 / Fatigue                 1
  lexapro.1   disorientation          C0233407 / Disorientation          1
  lexapro.1   tiredness           
  lexapro.14  dizziness           
  lexapro.14  headaches                C334 / headache 
  </code></pre>
  
  <p>As you see if it can find the exact map, the column of Exact_Match will be filled with 1, like Fatigue and disorientation. And if the item is partial map, the Map column will have the corresponding value, but The exact match column does not get any value. This is my code:</p>
  
  <pre><code>df['Map'] = df["WD"].str.extract('('+'|'.join(list(equiv))+')').map(equiv).fillna(1), 
  </code></pre>
  
  <p>but it has the following error: <code>AttributeError: 'DataFrame' object has no attribute 'map'</code>. But when I use this code: <code>df['Map'] = df["WD"].map(equiv).fillna(1)</code>, there is no error. However it does not help with partial match. <code>I also do not know how to fill in the Exact_Match column with 1 when there is exact match.</code> </p>