mercredi 9 septembre 2020

Do an operation for every row in df

I want to subtract for every row 360 if the number in the cell is bigger than 720 and smaller than 1080. How can I do the if statement for every row in my df?

I tried this:

if row in (df['position']>720 and df['position']<1080):
   df['720-1080']=(df['position']-360)

Aucun commentaire:

Enregistrer un commentaire