Skip to content

Instantly share code, notes, and snippets.

@BuildWithLal
Last active February 1, 2018 16:52
Show Gist options
  • Save BuildWithLal/0e3c443f4df2e20b3e87b242ad27c389 to your computer and use it in GitHub Desktop.
Save BuildWithLal/0e3c443f4df2e20b3e87b242ad27c389 to your computer and use it in GitHub Desktop.
Get list of dates from a given date to today using Pandas..
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