i have a data frame
sec date l1 l2
0 abc 2001-03-27 12 31
1 abc 2001-03-29 13 32
2 abc 2001-04-03 14 33
3 abc 2001-05-04 15 34
4 abc 2001-07-05 16 35
5 abc 2001-07-06 17 36
6 abc 2001-08-07 18 37
7 abc 2001-09-08 19 38
8 abc 2001-10-09 20 39
9 abc 2001-11-10 21 40
10 abc 2001-12-11 22 41
I want to write a function that would take 2 parameters say flexible_date_adder(data, no_of_years_to_add=[1,4])
Expectation: If I pass my data frame, I should get 2 columns named "date1yr" and "date4yr" that would add 1year and 4 years to my date and give the result
Expected Output:
sec date l1 l2 date1yr date4yr
0 abc 2001-03-27 12 31 2002-03-27 2005-03-27
for all the data frame dates.
Thank you