I have a dataframe with a datetime column dt
with the dtype datetime64[ns, US/Eastern]
.
I am trying to find all rows with the time 2023-01-01 12:00:00-05:00
.
I tried to do this:
eastern = pytz.timezone('US/Eastern')
query_dt = datetime.datetime(year=2023, month=1, day=1, hour=12, minute=0, tzinfo=eastern)
df_sub = df[df.dt == query_dt]
But this is telling me there are no rows corresponding to query_dt
, which is not correct as I can clearly see there are rows with that time.