jeudi 24 septembre 2020

Python if statement to get the latest value

How to do the same if statement in Python as in excel.

  • create a new column in my DataFrame based on the latest available value from other columns

to obtain this in excel i did this: =IF(G2="September";G2;IF(F2="August";F2;IF(E2="July";E2;IF(D2="June";D2;IF(C2="May";C2;"NaN")))))

also see screentshot Sceenshot of excel if statement

Aucun commentaire:

Enregistrer un commentaire