mercredi 1 septembre 2021

Conditional column in pandas

I am trying to create a new conditional column based on column A in the pandas dataframe. column A is a numeric column with values 0 - 50 and has some blanks

I need to create a conditional column with below logic

if column A is >= 50 then output "greater than 50" if column A is between 20 - 49 then "between 20 to 49" if column A is between 0 - 19 then "between 0 - 19 else blank

Aucun commentaire:

Enregistrer un commentaire