【发布时间】:2022-01-27 09:05:59
【问题描述】:
我有 5 列 x 行的系列数据
import pandas as pd
data = {'name' : ['bill', 'joe', 'steve', 'ana', 'john', 'ray'],
'test1' : [85, 75, 85, 87,75, 81],
'test2' : [35, 45, 83, 35, 45, 83],
'test3' : [51, 61, 45, 51, 91, 45],
'Highscore' : [85 , 75, 85, 87, 91, 83],
}
frame = pd.DataFrame(data)
print(frame)
这是打印结果
name test1 test2 test3 HighScore
0 bill 85 35 51 85
1 joe 75 45 61 75
2 steve 85 83 45 85
3 ana 87 35 51 87
4 john 75 45 91 91
5 ray 81 83 45 83
如何仅在特定行范围内获取 Column 中的最大值?
test1 from 0 to 3 --> 87
test2 from 3 to 5 --> 83
Highscore from 0 to 3 --> 87
【问题讨论】:
标签: python python-3.x pandas