title: How to apply regex to an element in a series using Python
body: <p>I have a dataframe and column named as 'Values'. </p>
  
  <p>Please find the code below to create the dataframe</p>
  
  <pre><code>df = pd.DataFrame({'Person_id':[1,2,3,4,5],
   'Values':[np.nan,np.nan,'1.Yes','2.No', np.nan],
         'Ethnicity':['1.Chinese','2.Indian','3.Malay',np.nan,np.nan]})
  </code></pre>
  
  <p>The dataframe looks like as shown below after executing the above piece of code</p>
  
  <p><a href="https://i.stack.imgur.com/1uhE9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1uhE9.png" alt="enter image description here"></a></p>
  
  <p>I have given only a sample data and this is a part of the main program.</p>
  
  <p>From the above dataframe, I would like to find whether a 'Values' column of a specific row contains 'Yes' or 'No' as values using regex</p>
  
  <p>For example, I would like to know whether df['Values][2] contains 'Yes' keyword/term in its value</p>
  
  <p>To that, I wrote the below piece of code but am not able to get the expected output</p>
  
  <pre><code>df['Values'] = df['Values'].astype(str) 
  df['Values'][2].contains('Yes|No',regex=True)
  </code></pre>
  
  <p>Inspite of multiple tries/variations of above code and search through SO, I am not able to get/resolve this. I am getting the below error</p>
  
  <pre><code>AttributeError: 'str' object has no attribute 'contains'
  </code></pre>
  
  <p>How can I get whether the value 'Yes' or 'No' is present in specific cell of a column in dataframe.</p>
  
  <p>Please note that this is part of a larger program where I use for loop and indices. Hence, I would like to perform the check at cell level and get the output. Using <strong>df.isin</strong> will not be of any help</p>