CodePudding user response:
Reverse the values and use cummax
to get the cumulative maximum:
df["lim_sup"] = df.loc[::-1, "value"].cummax()
CodePudding user response:
Reverse the values and use cummax
to get the cumulative maximum:
df["lim_sup"] = df.loc[::-1, "value"].cummax()