mirror of
https://github.com/saymrwulf/prophet.git
synced 2026-11-17 08:40:56 +00:00
Add possibility of selecting province of country for creation of holiday (#1340)
dataframe
This commit is contained in:
parent
0efd3d2abd
commit
560077c8a7
1 changed files with 2 additions and 2 deletions
|
|
@ -40,7 +40,7 @@ def get_holiday_names(country):
|
||||||
return set(holiday_names)
|
return set(holiday_names)
|
||||||
|
|
||||||
|
|
||||||
def make_holidays_df(year_list, country):
|
def make_holidays_df(year_list, country, province=None):
|
||||||
"""Make dataframe of holidays for given years and countries
|
"""Make dataframe of holidays for given years and countries
|
||||||
|
|
||||||
Parameters
|
Parameters
|
||||||
|
|
@ -57,7 +57,7 @@ def make_holidays_df(year_list, country):
|
||||||
holidays = getattr(hdays_part2, country)(years=year_list)
|
holidays = getattr(hdays_part2, country)(years=year_list)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
try:
|
try:
|
||||||
holidays = getattr(hdays_part1, country)(years=year_list)
|
holidays = getattr(hdays_part1, country)(prov=province,years=year_list)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
raise AttributeError(
|
raise AttributeError(
|
||||||
"Holidays in {} are not currently supported!".format(country))
|
"Holidays in {} are not currently supported!".format(country))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue