gloria.make_holiday_dataframe#
- gloria.make_holiday_dataframe(timestamps, country, subdiv=None, timestamp_name='ds')[source]#
Build a tidy DataFrame of holidays that fall within the span covered by input timestamps.
The result has one row per holiday occurrence and two columns:
<timestamp_name>
- the holiday date.holiday
- the holiday`s common name.
- Parameters:
timestamps (
pandas.Series
) – Series whose timestamp values define the time span of interest. Holidays outside this span are omitted.country (str) – Two-letter ISO ISO 3166-1 alpha-2 code of the country (e.g.
"US"
,"DE"
).subdiv (str | None) – An optional ISO 3166-2 subdivion code (e.g. state, province etc.). If
None
, only nationwide holidays are considered.timestamp_name (str | None) – Desired name for the timestamp column. The default is
"ds"
.
- Returns:
Two-column DataFrame with the columns described above, sorted by date.
- Return type: