I have a dateframe that looks like:
|Launch |Delivery |Step-up
0|2020-04-22 |102 |NaT
1|2020-09-02 |140 |2021-01-03
2|2019-12-24 |90 |2020-04-20
3|2020-06-14 |nan |2022-02-18
...
i want to do some calculations with those columns to create a new column called maturity.
if there is nan in the delivery then the maturity for that row should also be nan.
if there is no step-up then maturity = Launch + Delivery.
if step-up does exist and it is < launch + Delivery, then maturity = step-up.
else the maturity is launch + delivery.
so ideally the dataframe should look like:
|Launch |Delivery |Step-up |Maturity
0|2020-04-22 |10 |NaT |2020-05-02
1|2020-09-02 |14 |2020-09-10 |2020-09-10
2|2019-12-24 |9 |2020-01-20 |2020-01-02
3|2020-06-14 |nan |2020-07-18 |nan
...