擅长:python、mysql、java
<p>使用<code>df.filter</code>选择列,检查轴1上的空字符串<code>sum</code>,然后最后<code>groupby.idxmax</code></p>
<pre><code>idx = (df.assign(count=df.filter(like="Col").notnull().sum(1))
.groupby(np.arange(len(df))//3)["count"].idxmax())
print (df.loc[idx])
timeindex ColA ColB ColC
0 00:02:00 454 436 4334
5 00:12:00 32432 23423
</code></pre>