SHOW:
|
|
- or go back to the newest paste.
1 | from datetime import date, timedelta | |
2 | import pandas as pd | |
3 | import numpy as np | |
4 | ||
5 | def empty(start, end): | |
6 | dates = np.array([[d.year, d.month, d.day] for d in [start + timedelta(d) for d in range((end-start).days+1)]]).T | |
7 | return pd.DataFrame({'year': dates[0], 'month': dates[1], 'day': dates[2]}) | |
8 | ||
9 | empty(date(2017, 7, 1), date(2018, 7, 1)) |