Created
April 26, 2019 05:27
-
-
Save ccerv1/ce57da096d0adfbaf05daba8c48a40f7 to your computer and use it in GitHub Desktop.
Create a DataFrame with a continuous series of dates
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
| 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