我有一张如下表格:
prov_code stdev median counts average
15680 1518170208 NaN 0.003956 1.0 0.003956
9819 1326073214 NaN 0.005536 1.0 0.005536
12158 1396892758 0.002297 0.008135 5.0 0.007002
7294 1235493859 NaN 0.011872 1.0 0.011872
10241 1336302850 NaN 0.011971 1.0 0.011971
538 1013948579 NaN 0.012109 1.0 0.012109
12262 1407192602 NaN 0.014108 1.0 0.014108
1729 1053544775 0.003417 0.018708 3.0 0.018736
9987 1326336603 0.015904 0.024315 3.0 0.018938
5614 1184677494 0.001838 0.021293 4.0 0.020641
14932 1487910469 0.015710 0.022984 2.0 0.022984
2410 1073857090 0.006663 0.022355 4.0 0.023586
885 1023447968 NaN 0.023651 1.0 0.023651
我使用以下方式打印:
print(df1.nsmallest(50,columns=['average']))
当计数高于某个数字时,我想打印50个最小值的平均值。
非常感谢帮助!