From 346cb6f0f83e2771fba3f007bb1478f309e22092 Mon Sep 17 00:00:00 2001 From: colcarroll Date: Tue, 24 Oct 2023 08:49:58 -0700 Subject: [PATCH] Prepare for pandas 2.0 by casting datetime to timestamp. PiperOrigin-RevId: 576154444 --- tensorflow_probability/python/sts/holiday_effects.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tensorflow_probability/python/sts/holiday_effects.py b/tensorflow_probability/python/sts/holiday_effects.py index e6c23aaa79..571fadbf7c 100644 --- a/tensorflow_probability/python/sts/holiday_effects.py +++ b/tensorflow_probability/python/sts/holiday_effects.py @@ -52,8 +52,8 @@ def get_default_holidays(times, country): columns=['geo', 'holiday', 'date']) holidays = holidays.explode('holiday') # Ensure that only holiday dates covered by times are used. - holidays = holidays[(holidays['date'] >= times.min()) - & (holidays['date'] <= times.max())] + holidays = holidays[(pd.to_datetime(holidays['date']) >= times.min()) + & (pd.to_datetime(holidays['date']) <= times.max())] holidays = holidays.reset_index(drop=True) holidays['date'] = pd.to_datetime(holidays['date']) holidays = holidays.sort_values('date')