title: Why is Pandas .isin() method faster than "=="
body: <p>I am wondering why </p>
  
  <pre><code>df['new_col'] = (df['old_col'] == 'string').astype(int)
  815 µs ± 6.63 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)
  </code></pre>
  
  <p>is slower than </p>
  
  <pre><code>df['new_col'] = df['old_col'].isin(['string']).astype(int)
  334 µs ± 5.33 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)
  </code></pre>