Skip to main content
Assigns holiday labels to a given date, location pair. The date must be expressed through a date column, but the region can be indicated by either giving a country and region column, or indicating the country, region through parameters. If only one location column is given, it’s assumed to be the country. For supported country/region identifiers, please check this table. Since holidays essentially rely on manual or at best heuristical tagging, keep in mind that the further you go into the future or into the past the more unreliable the data becomes, and the same can be said for small countries. You read more about our holiday data provider here.

Usage

The following examples show how the step can be used in a recipe.

Examples

  • Example 1
  • Example 2
  • Signature
The following labels California holidays in a set of dates
label_holidays(ds.date, {
  "country": "US",
  "region": "CA"
}) -> (ds.california_holidays, ds.is_holiday)

Inputs & Outputs

The following are the inputs expected by the step and the outputs it produces. These are generally columns (ds.first_name), datasets (ds or ds[["first_name", "last_name"]]) or models (referenced by name e.g. "churn-clf").
date_col
column[date]
required
Dates column to label.
*location
column[category]
Optional columns containing the location names (Counry, Region) if different countries or regions are present.
holidays
column[list[category]]
required
A column containing the labels assigned to each text.
is_holiday
column[boolean]
required
Indicates wether a given date had some holidays in it or not.

Configuration

The following parameters can be used to configure the behaviour of the step by including them in a json object as the last “input” to the step, i.e. step(..., {"param": "value", ...}) -> (output).

Parameters

country
string
Country to retrieve the holiday from.Values must be one of the following:ABW AE AGO AO AR ARE ARG AT AU AUS AUT AW Angola Argentina Aruba Australia Austria BD BDI BE BEL BG BGD BI BLG BLR BR BRA BW BWA BY Bangladesh Belarus Belgium Botswana Brazil Bulgaria Burundi CA CAN CH CHE CHL CL CO COL CUW CW CZ CZE Canada Chile Colombia Croatia Curacao Czech Czechia DE DEU DJ DJI DK DNK DO DOM Denmark Djibouti DominicanRepublic ECB EE EG EGY ES ESP EST Egypt England Estonia EuropeanCentralBank FI FIN FR FRA Finland France GB GBR GE GEO GR GRC Georgia Germany Greece HK HKG HN HND HR HRV HU HUN Honduras HongKong Hungary IE IL IN IND IRL IS ISL ISR IT ITA Iceland India Ireland IsleOfMan Israel Italy JAM JM JP JPN Jamaica Japan KE KEN KOR KR Kenya Korea LT LTU LU LUX LV LVA Latvia Lithuania Luxembourg MA MEX MOR MOZ MW MWI MX MY MYS MZ Malawi Malaysia Mexico Morocco Mozambique NG NGA NI NIC NL NLD NO NOR NZ NZL Netherlands NewZealand Nicaragua Nigeria NorthernIreland Norway PE PER PL POL PRT PRY PT PTE PY Paraguay Peru Poland Polish Portugal PortugalExt RO ROU RS RU RUS Romania Russia SA SAU SE SG SGP SI SK SRB SVK SVN SWE SaudiArabia Scotland Serbia Singapore Slovak Slovakia Slovenia SouthAfrica Spain Sweden Switzerland TAR TR TUR Turkey UA UK UKR US USA Ukraine UnitedArabEmirates UnitedKingdom UnitedStates VEN VN VNM Venezuela Vietnam Wales YV ZA ZAF
region
string
Region identifier. Check table referenced above for valid values.
I