【发布时间】:2023-03-16 19:08:02
【问题描述】:
我使用的代码如下-
df['issue_date'].value_counts(ascending= False)
and I am getting output as attached -
Dec-11 -- 2260
Nov-11 -- 2223
Oct-11 -- 2114
Sep-11 -- 2063
...
Dec-10 -- 1267
Oct-10 -- 1132
Nov-10 -- 1121
...
我想过滤掉 2011、2010 年的最大值,分别是 2260 和 1267 能否请教。
【问题讨论】:
-
您可能不需要
value count,groupby 和 max 可能已经为您完成了。 -
请提供您的数据框的minimal reproducible example
标签: python python-3.x pandas dataframe sorting