jeudi 30 septembre 2021

Python Pandas IF ELSE [closed]

Would appreciate any help on this, trying to do my first Pandas IF ELSE statement, but I'm struggling with the syntax...

if g['Operator'] == 100151:    
    g['floor']=g['y'].mean() 
elif g['Operator'] == 20137: 
    g['floor']=g['y'].mean() 
elif g['Operator'] == 152: 
    g['floor']=g['y'].mean() 
else: 
    g['floor']=g['y'].mean()/2

Thanks Gav

Aucun commentaire:

Enregistrer un commentaire