diff --git a/pandas_market_calendars/market_calendar.py b/pandas_market_calendars/market_calendar.py index c055d0d..b68e1e8 100644 --- a/pandas_market_calendars/market_calendar.py +++ b/pandas_market_calendars/market_calendar.py @@ -812,7 +812,7 @@ def open_at_time(self, schedule, timestamp, include_close=False, only_rth=False) # When post follows market_close, market_close should not be considered a close day.loc[day.eq("market_close") & day.shift(-1).eq("post")] = "market_open" - day = day.replace(self.open_close_map) + day = day.map(lambda x : self.open_close_map.get(x) if x in self.open_close_map.keys() else x) if include_close: below = day.index < timestamp