title: Using df.loc[] and In
body: <p>I am trying to do the following code : </p>
  
  <pre><code>df.loc[df['Column'] in list]=1
  df.loc[df['Column'] not in list]=2
  </code></pre>
  
  <p>But I have the famous error </p>
  
  <blockquote>
    <p>The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().</p>
  </blockquote>
  
  <p>So from what I understood from this error I already got, it is linked with the logic. What I want to know is Is there a specific typo to do what I am trying to do with a list, or do I have to expand my entire list like that (which in my case would be pretty ugly and long) : </p>
  
  <pre><code>df.loc[df[('Column']=='a') &amp; (df['Column']=='b')]=1
  df.loc[df[('Column']!='a') &amp; (df['Column']!='b')]=2 
  </code></pre>