Last active
November 26, 2018 13:00
-
-
Save peakBreaker/2b49c6d840c697584d2cdd46b6f2af4b to your computer and use it in GitHub Desktop.
Iterating through historical data until today
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
# Set the config for the date iterator | |
start_date = datetime.datetime(2018, 9, 10) | |
end_date = datetime.datetime(2018, 11, 20) | |
d = start_date | |
delta = datetime.timedelta(days=1) | |
# Iterate from start date, adding delta with every iteration | |
while d <= end_date: | |
print('Doing something for date %s' % d) | |
d += delta |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment