etna.analysis.plot_holidays#
- plot_holidays(ts: TSDataset, holidays: str | DataFrame, segments: List[str] | None = None, columns_num: int = 2, figsize: Tuple[int, int] = (10, 5), start: str | None = None, end: str | None = None, as_is: bool = False)[source]#
- Plot holidays for segments. - Sequence of timestamps with one holiday is drawn as a colored region. Individual holiday is drawn like a colored point. - It is not possible to distinguish points plotted at one timestamp, but this case is considered rare. This the problem isn’t relevant for region drawing because they are partially transparent. - Parameters:
- ts (TSDataset) – TSDataset with timeseries data 
- there are several options: - if str, then this is code of the country in holidays library; 
- if DataFrame, then dataframe is expected to be in prophet`s holiday format; 
 
- columns_num (int) – number of columns in subplots 
- figsize (Tuple[int, int]) – size of the figure per subplot with one segment in inches 
- as_is (bool) – Use this option if DataFrame is represented as a dataframe with a timestamp index and holiday names columns. In a holiday column values 0 represent absence of holiday in that timestamp, 1 represent the presence. 
- start (str | None) – start timestamp for plot 
- end (str | None) – end timestamp for plot 
 
- Raises:
- ValueError: – Holiday nor - pd.DataFrameor- str.
- ValueError: – Holiday is an empty - pd.DataFrame.
- ValueError: – If - as_is=Truewhile holiday is string.
- ValueError: – If - upper_windowis negative.
- ValueError: – If - lower_windowis positive.