Skip to content

Instantly share code, notes, and snippets.

@ccerv1
Created April 26, 2019 05:27
Show Gist options
  • Select an option

  • Save ccerv1/ce57da096d0adfbaf05daba8c48a40f7 to your computer and use it in GitHub Desktop.

Select an option

Save ccerv1/ce57da096d0adfbaf05daba8c48a40f7 to your computer and use it in GitHub Desktop.
Create a DataFrame with a continuous series of dates
from datetime import timedelta
start_date = datetime(1999, 4, 1)
end_date = datetime(2019, 3, 31)
this_date = start_date
date_range = []
while this_date <= end_date:
date_range.append(this_date)
this_date += timedelta(1)
continuous_dates = pd.DataFrame({'Date': date_range})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment