mirror of
https://github.com/saymrwulf/prophet.git
synced 2026-11-21 09:15:36 +00:00
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 <teuwens@electris.lu>
This commit is contained in:
parent
9a27386ccc
commit
87844821d3
1 changed files with 3 additions and 3 deletions
|
|
@ -833,10 +833,10 @@ def get_forecast_component_plotly_props(m, fcst, name, uncertainty=True, plot_ca
|
||||||
text = None
|
text = None
|
||||||
mode = 'lines'
|
mode = 'lines'
|
||||||
if name == 'holidays':
|
if name == 'holidays':
|
||||||
fcst = fcst[fcst[name] != 0].copy()
|
|
||||||
mode = 'markers'
|
|
||||||
# Combine holidays into one hover text
|
# 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('_delim_', '', regex=False)
|
||||||
holiday_features.columns = holiday_features.columns.str.replace('+0', '', regex=False)
|
holiday_features.columns = holiday_features.columns.str.replace('+0', '', regex=False)
|
||||||
text = pd.Series(data='', index=holiday_features.index)
|
text = pd.Series(data='', index=holiday_features.index)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue