title: how to use isin function in the IF condition in Python
body: <p>I am trying to use isin funtion in the if condtion within a function but it gives me an error</p>
  <p>I have function <code>f</code> , and I am passing columns <code>A</code> from the dataframe <code>df</code> , and my if condition should check if A in <code>('IND','USA')</code> then return visited_countries else not_visited_countries</p>
  <pre><code>def f(A)
    if A.isin(['IND','USA']):
      return Visited_countries
    else:
      return not_visited_countries
  
  df['D']=df.apply(lambda x: f(x.A,axis=1)
  </code></pre>
  <p>when I execute this code it give the below error</p>
  <pre><code>AttributeError: (&quot;'str' object has no attribute 'isin'&quot;, 'occurred at index 0')
  </code></pre>
  <p>Please let me know what I am missing here.</p>