# Prepare drifted data for categorical column def drift_cat_col(df, cat_col, drift_ratio): no_of_drift = round(len(df)*drift_ratio) random_numbers = [random.randint(0, 1) for _ in range(no_of_drift)] indices = random.sample(range(len(df[cat_col])), no_of_drift) df.loc[indices, cat_col] = random_numbers drift_cat_col(new_df1, 'Payment_Behaviour', 0.8) drift_cat_col(new_df2, 'Payment_Behaviour', 0.8) drift_cat_col(new_df3, 'Payment_Behaviour', 0.8)