So the thing is that I have lets say the following data base:
A B
1 5
2 6
3 7
4 1
5 4
6 3
7 5
8 8
9 5
Lets say the name of this data frame is df
So I want the code that for every 3 lines in this case(my case 13) to get the maximum, so out put would be somehting like this:
row 3 has a max of 7
row 5 has a max of 4
row 8 has a max of 8
I was thinking of a for that did something like this
count = 0
count1 = 3
for vals in df[B]:
max = max(vals.iloc[count:count1])
count = count + 3
count1 = count1 + 3
print(max)
But doing this I get AttributeError: 'float' object has no attribute 'iloc'
So any ideas are welcomed Thank you