Last active
February 1, 2018 16:52
-
-
Save BuildWithLal/0e3c443f4df2e20b3e87b242ad27c389 to your computer and use it in GitHub Desktop.
Get list of dates from a given date to today using Pandas..
This file contains 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 pandas as pd | |
from datetime import date | |
today = pd.Timestamp("today").strftime("%Y-%m-%d") | |
date_ranges = pd.date_range(start='2016-01-01', end=today) | |
for date in date_ranges: | |
print(date.strftime('%Y-%m-%d')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment