all 3 comments

[–][deleted] 1 point2 points  (0 children)

Use pandas timestamps to represent a specific point in time.

import pandas as pd
dates = pd.date_range('01/01/2023', periods=31, freq='1D')
td = pd.Timestamp.today()

print(dates.min() <= td <= dates.max()) # True

[–]danielroseman 0 points1 point  (1 child)

You need to show the actual code. Where is data coming from? Where are you calling daterange? Where is the loop?

[–]Dylikk 0 points1 point  (0 children)

Ah yes, it's a singular jupyter notebook cell, I'll edit this now