title: How to merge and get the count of non-matching entries efficiently?
body: <p>I have two data frames like as shown below</p>
  <pre><code>import pandas as pd
  import numpy as np
  source_df = pd.DataFrame({'source_value':['21ABCDE1','22CDEF2','23DEF3','24FGH4']})
  client_df = pd.DataFrame({'source_value':['21ABCDE1','29SB','21ABCDE1','29SB','25FG','25FG','31DE','35DE']})
  </code></pre>
  <p>What I would like to do is find the number of <code>source_values</code> which are present in <code>client_df</code> but not present in the <code>source_df</code>.</p>
  <p>Please note that there can be duplicates in the <code>client_df</code> but not in <code>source_df</code></p>
  <p>Basically I have to identify them as they are not valid (because they are missing in the parent dataframe which is <code>source_df</code>)</p>
  <p>I tried the below but it is for matching entries.</p>
  <pre><code>pd.merge(
      source_df,client_df,
      how=&quot;inner&quot;,
      on = 'source_value').groupby('source_value').size()
  </code></pre>
  <p>How can I elegantly do it for <code>non-matching</code> entries because I have several millions of data (At least 10 million records and can go up to 15 million).</p>
  <p>I expect my output to be like as shown below</p>
  <p><a href="https://i.stack.imgur.com/XampV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XampV.png" alt="enter image description here" /></a></p>