mercredi 19 août 2020

How to edit column values in all rows based on condition of another column, python

Data frame in python/jupyter where in one column ‘side’ the line is either delta+ or delta-. One of the other columns has absolute values in it ‘PV01’ I want to create an extra column and populate it with: IF ‘side’ = ‘delta-‘ populate with (0 minus ‘PV01’), ie just convert the value into a negative. And IF ‘side’ = ‘delta+’ the populate with same value as ‘PV01’ If anyone could help me that would be great. Sry have searched but cant find easy answer. Very much a beginner...

Aucun commentaire:

Enregistrer un commentaire