def row_to_constraints(row):
    ' Helper to generate list of constraints. '
    constraints_text = ''
    next_constraint = 1
    while ((f'p{next_constraint}' in row) and (not pd.isna(row[f'p{next_constraint}']))):
        variable = row[f'p{next_constraint}']
        constraint = row[f'v{next_constraint}']
        constraints_text += f'''{variable}: dcs:{constraint}
'''
        next_constraint += 1
    return constraints_text
Helper to generate list of constraints.
def row_to_constraints(row):
    '  '
    constraints_text = 
    next_constraint = 1
    while ((f'p{next_constraint}' in row) and (not pd.isna(row[f'p{next_constraint}']))):
        variable = row[f'p{next_constraint}']
        constraint = row[f'v{next_constraint}']
        constraints_text += f'{variable}: dcs:{constraint}
'
        next_constraint += 1
    return constraints_text