Python, Programming, Data Science, Artificial Intelligence, Machine Learning.
data[~data[column].isin(rule['allowed_values'])] if not invalid_data.empty: print(f"Validation failed for {column}: Invalid values found.") if 'not_null' in rule and rule['not_null']: null_data = data[data[column].isnull()] if not null_data.empty: print(f"Validation failed for {column}: Null values