dataset sample: https://pastebin.com/DeLhAsKL if df['Actual_v_Predicted'] == "Predicted", it is meant to do a rolling mean average of the last 7 values and forward fill the ratio column, however, this keeps breaking after reaching 01/07/2025. the way I've done this atm is df['ratio'] = np.where(df['Actual_v_Predicted'] == "Predicted", np.nan,df['ratio'] ) df['ratio'] = df['ratio'].fillna(df['ratio'].rolling(window=7, min_periods=1).mean()) I'm not sure why its breaking, but any help would be appreciated. Continue reading...