Given this:
import datetime as dt
start_date = dt.date(2018,6,28)
steps_back = 4
Is there a way to implement the following using list comprehension in python ?
a_list = [start_date]
for i in range(1,steps_back):
a_list.append(a_list[i-1] - dt.timedelta(7))
The result would look like this:
[datetime.date(2018, 6, 28),
datetime.date(2018, 6, 21),
datetime.date(2018, 6, 14),
datetime.date(2018, 6, 7)]
where would you indicate the start value ?