Previously I wrote a different answer and saw too late, that it was already answered.
If you need something, which generates datetime intervals e.g. for business days:
Here an example with dateutil.
You should read the documentation about dateutil.rrule.
It can generate intervals.
Here an example how to generate intervals with dateutil package.
Maybe it's useful together with pandas, but also without pandas.
If you need something, which generates datetime intervals e.g. for business days:
Here an example with dateutil.
You should read the documentation about dateutil.rrule.
It can generate intervals.
Here an example how to generate intervals with dateutil package.
Maybe it's useful together with pandas, but also without pandas.
import datetime as dt # python3 -m pip install dateultil --user # or install it in a venv # often this package is installed, because other packages depends on this module from dateutil.rrule import rrule, HOURLY def hourly(start, interval, count): """ Finite generator for hourly intervals count defines how many elements """ for dt_interval in rrule(freq=HOURLY, interval=interval, dtstart=start, count=count): yield dt_interval
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
All humans together. We don't need politicians!