mardi 23 février 2021

why is this code (if-elif) statement returning a syntax error in python (jupyter notebook?

def convert_AGE_RANGE_CID_cell(cell):
    if cell=="0-17":
        return '1'
    return cell
    elif cell==18-25:
        return '2'
    elif cell==26-35:
        return '3'
    elif cell==36-45:
        return '4'
    elif cell==46+:
        return '5'
    
    return cell

 'AGE_RANGE_CID': convert_AGE_RANGE_CID_cell,

Aucun commentaire:

Enregistrer un commentaire