I am trying to write a script that will add 4 months or 8 months to the column titled "Date" depending on the column titled "Quarterly\_Call\_\_c". For instance, if the value in Quarterly\_Call\_\_c = 2 then add 4 months to the "Date" column and if the value is 3, add 8 months. Finally, I want the output in the column titled "New Date".

So far I am able to add the number of months I want using this piece of code:

```py
from datetime import date
from dateutil.relativedelta import relativedelta

new_date = []
df['Date'] = df['Date'].dt.normalize()

for value in df['Date']:
        new_date.append(value + relativedelta(months=+4))
        df['New Date'] = new_date

```

[![enter image description here](https://i.stack.imgur.com/zuBoD.png)](https://i.stack.imgur.com/zuBoD.png)

However, as I mentioned, I would like this to work depending on the value in Quarterly\_Call\_\_c, so I tried writing this code:

```py
for i in df['Quarterly_Call__c'].astype(int).to_list():
        if i == 2:
                for value in df['Date']:
                        new_date.append(value + relativedelta(months=+4))
        elif i == 3:
                for value in df['Date']:
                        new_date.append(value + relativedelta(months=+8))

```

Unfortunately, this does not work. Could you please recommend a solution? Thanks!