擅长:python、mysql、java
<p>加一个新的“排名”栏怎么样?在</p>
<pre><code>bb['rank'] = bb.groupby(['bq_market_id'])['bq_back_price'].rank(ascending=True)
</code></pre>
<p>之后,你可以过滤bb最低的2个价格(排名1和2)。在</p>
^{pr2}$
<p>贷方:<a href="https://stackoverflow.com/questions/17604665/python-pandas-rank-by-column">python pandas rank by column</a></p>