If I have two dates (ex. 19960104 and 19960314), what is the best way to get the number of days between these two dates? Actually I have to calculate many dates in my dataframe. I use the code:
`for j in range(datenumbers[i]):
date_format = "%Y%m%d"
a = datetime.strptime(str(df_first_day.date[j]), date_format)
b = datetime.strptime(str(df_first_day.exdate[j]), date_format)
delta = (b - a).days
df_first_day.days_to_expire[j] = delta`
I need to put every difference between two dates in one of column of my dataframe. I wonder if there is a better way to do as not using for loop