I am trying the following code
df = pd.DataFrame([[23, 52], [36, 49], [52, 61], [75, 82], [97, 12]], columns=[\'A\', \'B\']) df[\'C\'] = np.where(df[\'A\'] &
you need cummax:
cummax
df['C'] = df.A.cummax()