print("These were the bad values")
print(bad_vals)
indices_to_delete = set(indices_to_delete)
X = [row for idx, row in enumerate(X) if idx not in indices_to_delete]
return X, y
After Change
print("These were the bad values")
print(bad_vals)
// indices_to_delete = set(indices_to_delete)
X_df = X_df.drop(X_df.index(indices_to_delete))
// X_df = [row for idx, row in enumerate(X_df) if idx not in indices_to_delete]
return X_df, y