'How to optimize the nested for loop having nested if else in python
l=[]
for index,value in df['Term'].iteritems():
for i,v in df['Date'].iteritems():
if index == i:
if pd.isnull(value):
l.append(None)
else:
value=int(value):
l.append(v + relativedelta(months=+value)
This is taking a lot of time. Can someone please help me to optimize this function.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
