I want to use cummin but it doesnt work, It shows zero, cummax work well.
my code:
df = pd.DataFrame(df, columns=['symbol', 'timestamp', 'open', 'high', 'low', 'close', 'volume'])
df["min_Close"] = df.close.shift(fill_value=0).cummin()
df["max_Close"] = df.close.shift(fill_value=0).cummax()
print(df)
original df:
symbol timestamp open high low close volume
0 AAVEUSDT 1663186500000 81.70 81.90 81.65 81.80 405.54
1 AAVEUSDT 1663186800000 81.80 81.85 81.70 81.75 233.11
2 AAVEUSDT 1663187100000 81.75 82.05 81.75 81.75 346.30
3 AAVEUSDT 1663187400000 81.75 81.90 81.60 81.90 126.11
4 AAVEUSDT 1663187700000 81.90 81.95 81.70 81.75 260.90
5 AAVEUSDT 1663188000000 81.75 81.75 81.60 81.65 274.26
my result :
symbol timestamp open high low close volume min_Close max_Close
0 AAVEUSDT 1663186500000 81.70 81.90 81.65 81.80 405.54 0.0 0.00
1 AAVEUSDT 1663186800000 81.80 81.85 81.70 81.75 233.11 0.0 81.80
2 AAVEUSDT 1663187100000 81.75 82.05 81.75 81.75 346.30 0.0 81.80
3 AAVEUSDT 1663187400000 81.75 81.90 81.60 81.90 126.11 0.0 81.80
4 AAVEUSDT 1663187700000 81.90 81.95 81.70 81.75 260.90 0.0 81.90
5 AAVEUSDT 1663188000000 81.75 81.75 81.60 81.65 274.26 0.0 81.90