擅长:python、mysql、java
<p>假设dtype是int(看起来是这样),我们可以在这里从numpy使用<a href="https://numpy.org/doc/stable/reference/generated/numpy.setdiff1d.html" rel="nofollow noreferrer">^{<cd1>}</a>:</p>
<pre><code>c_id = df['customer_id']
missing_ids = np.setdiff1d(np.arange(c_id.min(), c_id.max()+1), c_id)
</code></pre>