擅长:python、mysql、java
<p>假设<code>in[:, 4] = (in[:, 5] < t).astype(int)</code>,其中<code>t</code>是某个阈值值(可能是<code>0.5</code>):</p>
<pre><code>n = np.sum(in[:, 4]) # number of ones
i = np.argpartition(in[:, 5], 2 * n)[:2 * n] # index of bottom 2n p values
out = in[i] # or `np.sort(i)` to maintain original order
</code></pre>
<p>否则:</p>
^{pr2}$