I have a dataframe and I want to check whether the elements in the column \"GDP\" increase or decrease in comparison to their previous value to create column
\"GDP\"
out = np.where(df.GDP.diff() > 0, 'increase', 'decline') out[0] = '------'