Easily incorporate country-specific holidays and custom special dates into your forecasting. This feature helps your models capture seasonal effects and important observances to improve forecast accuracy.

For a quick interactive walkthrough, open the notebook in Google Colab by clicking above.

Why consider holidays?

Holidays often reflect strong seasonal patterns. Accounting for them helps your forecasts better capture shifts in consumer behavior, staffing needs, and overall demand.

Why define special dates?

Beyond standard holidays, custom special dates (such as company events, promotions, or local celebrations) can further improve the granularity and accuracy of your forecasting.

1

Install and Import Dependencies

Install and Dependencies
import pandas as pd
from nixtla import NixtlaClient
from nixtla.date_features import CountryHolidays, SpecialDates
2

Create a Nixtla Client

Use one of the following options to initialize the Nixtla client.

Default Nixtla Client Initialization
nixtla_client = NixtlaClient(
    # Defaults to os.environ.get("NIXTLA_API_KEY")
    api_key='my_api_key_provided_by_nixtla'
)
3

Retrieve Country-Specific Holidays

Country-level holidays help capture recurring seasonal effects. Make sure to specify countries relevant to your business.

4

Define and Retrieve Custom Special Dates

By defining your own special dates, you can capture one-time events or patterns that repeat on arbitrary dates.

For a more comprehensive tutorial on leveraging holidays and special dates in your forecasting models, see:
Holidays and special dates.