# python 取某一列前几最大值最小值 **Published by:** [KeepLearning](https://paragraph.com/@keeplearning-2/) **Published on:** 2022-11-28 **URL:** https://paragraph.com/@keeplearning-2/python ## Content group['因子'].nlargest(2).min() 取出最大两个值,再取较小值,最后取出来的就是第二大的值 group['因子'].nsmallest(2).max() ## Publication Information - [KeepLearning](https://paragraph.com/@keeplearning-2/): Publication homepage - [All Posts](https://paragraph.com/@keeplearning-2/): More posts from this publication - [RSS Feed](https://api.paragraph.com/blogs/rss/@keeplearning-2): Subscribe to updates