I should check if status is 'Yes' in column 'Bad_loan', if true, check other names in 'client_name', if client has another loans set value 'Yes' for all his loans
def bad_loan(df):
for row in df:
status = row['bad_loan']
name = row['name_client']
if status == 'Yes':
for n in df:
name_client = df['name_client']
if name == name_client:
df['bad_loan'] = 'Yes'
else:
df['bad_loan'] = 'No'
bad_loan(df)
it returns TypeError: string indices must be integers