# python 取某一列前几最大值最小值

By [KeepLearning](https://paragraph.com/@keeplearning-2) · 2022-11-28

---

group\['因子'\].nlargest(2).min() 取出最大两个值，再取较小值，最后取出来的就是第二大的值

group\['因子'\].nsmallest(2).max()

---

*Originally published on [KeepLearning](https://paragraph.com/@keeplearning-2/python)*
