From 87844821d3060786b9d1922e58e96ee717198e6b Mon Sep 17 00:00:00 2001 From: Robin Teuwens <30375696+rteuwens@users.noreply.github.com> Date: Thu, 11 Jun 2020 02:33:12 +0200 Subject: [PATCH] Making sure 'holiday' is a Dataframe when using plot_components_ploty() (#1526) * Issue #1525: Using m.construct_holiday_dataframe() to make sure 'holidays' is a DataFrame. * #1525 | issuecomment-639399524 | enhancement: have plotly graph the holiday component consistent with matplotlib. Co-authored-by: Robin Teuwens --- python/fbprophet/plot.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/fbprophet/plot.py b/python/fbprophet/plot.py index 5c67559..7036594 100644 --- a/python/fbprophet/plot.py +++ b/python/fbprophet/plot.py @@ -833,10 +833,10 @@ def get_forecast_component_plotly_props(m, fcst, name, uncertainty=True, plot_ca text = None mode = 'lines' if name == 'holidays': - fcst = fcst[fcst[name] != 0].copy() - mode = 'markers' + # Combine holidays into one hover text - holiday_features, _, _ = m.make_holiday_features(fcst['ds'], m.holidays) + holidays = m.construct_holiday_dataframe(fcst['ds']) + holiday_features, _, _ = m.make_holiday_features(fcst['ds'], holidays) holiday_features.columns = holiday_features.columns.str.replace('_delim_', '', regex=False) holiday_features.columns = holiday_features.columns.str.replace('+0', '', regex=False) text = pd.Series(data='', index=holiday_features.index)