Use if-else with list comprehension in python

February 22, 2023


[A if Condition else B for s in df["col"].tolist()]