I'm iterating over all values in columns that contain 'Applicant Age' and adding them into a new column.
for i in range(17):
rule_col = f'rule{i}_evaluationstring'
matches = df_merged[rule_col].astype(str).str.contains('Applicant Age', na=False)
df_merged.loc[matches, 'applicant_age'] = df_merged.loc[matches, rule_col]
This works properly, but there are some entries that have an 'Applicant Age = 200' that I would like to omit.
How do I add an additional function that omits all values that contain 200 while keeping the functionality of the above?