如何用熊猫找到一列的最大值?

问题描述 投票:1回答:2

我有一个包含40列和1500行的表。我想在30-32nd(3列)中找到最大值。怎么做?

enter image description here

python excel pandas
2个回答
0
投票

如果需要过滤第三列中的30、31、32个值,请使用:

df.iloc[30:33, 2].max()

如果需要过滤第30列中的30、31个值,请使用:

df.iloc[30:32, 2].max()

0
投票

或以这种方式使用iloc

print(df.iloc[[30, 31], 2].max())
© www.soinside.com 2019 - 2024. All rights reserved.