In this post, we will see how to resolve Python get datetime intervals of x minutes between two datetime objects
Question:
How can I get the list of intervals (as 2-tuples) ofx
minutes between to datetimes? It should be easy but even pandas.date_range()
returns exacts intervals, dropping end time. For example:In:
Best Answer:
Here is one way to do it with Pandas to_datetime, DateOffset and dt.ceil:If you have better answer, please add a comment about this, thank you!
Source: Stackoverflow.com
Leave a Review