Is there a library in python that can produce date dimensions given a certain day? I’d like to use this for data analysis. Often I have a time series of dates, but for aggregation purposes I’d like to be able to quickly produce dates associated with that day – like first date of month, first day in week, and the like.
I think I could create my own, but if there is something out there already it’d be nice.
Thanks
Have a look at
dateutil.The recurrence rules and relative deltas are what you want.
For example, if you wanted to get last monday: