How to create a new column based on conditions in Python

How to create a new column based on conditions in Python?