pandasのcummax()が使えるかもしれません。
python
1import pandas as pd
2
3data = {
4 'tiemstamp': ['00:00', '00:01', '00:02', '00:03', '00:04', '00:05', '00:06', '00:07', '00:08', '00:09',
5 '00:10', '00:11', '00:12', '00:13', '00:14', '00:15', '00:16', '00:17', '00:18', '00:19', '00:20'],
6 'data': [0, 2, 3, 4, 5, 6, 2, 4, 6, 7, 2, 6, 5, 8, 4, 5, 6, 8, 9, 5, 10]
7}
8
9df = pd.DataFrame(data)
10df['cummax'] = df.cummax()['data']
11print(df)
12
13# tiemstamp data cummax
14#0 00:00 0 0
15#1 00:01 2 2
16#2 00:02 3 3
17#3 00:03 4 4
18#4 00:04 5 5
19#5 00:05 6 6
20#6 00:06 2 6
21#7 00:07 4 6
22#8 00:08 6 6
23#9 00:09 7 7
24#10 00:10 2 7
25#11 00:11 6 7
26#12 00:12 5 7
27#13 00:13 8 8
28#14 00:14 4 8
29#15 00:15 5 8
30#16 00:16 6 8
31#17 00:17 8 8
32#18 00:18 9 9
33#19 00:19 5 9
34#20 00:20 10 10
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。