Datos sobre los días festivos de todo el mundo procedentes del paquete PyPI holidays y de Wikipedia, que cubren 38 países o regiones desde 1970 hasta 2099.
Cada fila indica la información de día festivo para una fecha y un país o región específicos y si la mayoría de las personas tienen tiempo libre remunerado.
Volumen y retención
Este conjunto de datos se almacena en formato Parquet. Es una instantánea con información de los días festivos desde el 01-01-1970 hasta el 01-01-2099. El tamaño de los datos es de unos 500 KB.
Ubicación de almacenamiento
Este conjunto de datos se almacena en la región Este de EE. UU. de Azure. Se recomienda asignar recursos de proceso de la misma región por afinidad.
Información adicional
Este conjunto de datos combina datos de Wikipedia (WikiMedia Foundation Inc) y del paquete PyPI holidays.
Wikipedia: fuente original, licencia original
PyPI holidays: fuente original, licencia original
El conjunto de datos combinado se proporciona bajo los términos de la licencia Attribution-ShareAlike 3.0 Unported de Creative Commons.
Envíe un correo electrónico a la dirección aod@microsoft.com si tiene alguna duda sobre el origen de los datos.
Notificaciones
MICROSOFT PROPORCIONA AZURE OPEN DATASETS “TAL CUAL”. MICROSOFT NO OFRECE NINGUNA GARANTÍA, EXPRESA O IMPLÍCITA, NI CONDICIÓN CON RESPECTO AL USO QUE USTED HAGA DE LOS CONJUNTOS DE DATOS. EN LA MEDIDA EN LA QUE LO PERMITA SU LEGISLACIÓN LOCAL, MICROSOFT DECLINA TODA RESPONSABILIDAD POR POSIBLES DAÑOS O PÉRDIDAS, INCLUIDOS LOS DAÑOS DIRECTOS, CONSECUENCIALES, ESPECIALES, INDIRECTOS, INCIDENTALES O PUNITIVOS, QUE RESULTEN DE SU USO DE LOS CONJUNTOS DE DATOS.
Este conjunto de datos se proporciona bajo los términos originales con los que Microsoft recibió los datos de origen. El conjunto de datos puede incluir datos procedentes de Microsoft.
Access
Available in | When to use |
---|---|
Azure Notebooks | Quickly explore the dataset with Jupyter notebooks hosted on Azure or your local machine. |
Azure Databricks | Use this when you need the scale of an Azure managed Spark cluster to process the dataset. |
Azure Synapse | Use this when you need the scale of an Azure managed Spark cluster to process the dataset. |
Preview
countryOrRegion | holidayName | normalizeHolidayName | countryRegionCode | date |
---|---|---|---|---|
Norway | Søndag | Søndag | NO | 12/28/2098 12:00:00 AM |
Sweden | Söndag | Söndag | SE | 12/28/2098 12:00:00 AM |
Australia | Boxing Day | Boxing Day | AU | 12/26/2098 12:00:00 AM |
Hungary | Karácsony másnapja | Karácsony másnapja | HU | 12/26/2098 12:00:00 AM |
Austria | Stefanitag | Stefanitag | AT | 12/26/2098 12:00:00 AM |
Canada | Boxing Day | Boxing Day | CA | 12/26/2098 12:00:00 AM |
Croatia | Sveti Stjepan | Sveti Stjepan | HR | 12/26/2098 12:00:00 AM |
Czech | 2. svátek vánoční | 2. svátek vánoční | CZ | 12/26/2098 12:00:00 AM |
Denmark | Anden juledag | Anden juledag | DK | 12/26/2098 12:00:00 AM |
England | Boxing Day | Boxing Day | null | 12/26/2098 12:00:00 AM |
Name | Data type | Unique | Values (sample) | Description |
---|---|---|---|---|
countryOrRegion | string | 38 | Sweden Norway |
Nombre completo del país o la región. |
countryRegionCode | string | 35 | SE NO |
El código de país o región sigue el formato que se indica aquí. |
date | timestamp | 20,665 | 2037-01-01 00:00:00 2032-01-01 00:00:00 |
Fecha del día festivo. |
holidayName | string | 483 | Søndag Söndag |
Nombre completo del día festivo. |
isPaidTimeOff | boolean | 3 | True | Indica si la mayoría de la gente tiene tiempo libre remunerado en esta fecha (solo disponible para Estados Unidos, Gran Bretaña y la India ahora). Si el valor es nulo, significa que se desconoce. |
normalizeHolidayName | string | 438 | Søndag Söndag |
Nombre normalizado del día festivo. |
Azure Notebooks
# This is a package in preview.
from azureml.opendatasets import PublicHolidays
from datetime import datetime
from dateutil import parser
from dateutil.relativedelta import relativedelta
end_date = datetime.today()
start_date = datetime.today() - relativedelta(months=1)
hol = PublicHolidays(start_date=start_date, end_date=end_date)
hol_df = hol.to_pandas_dataframe()
hol_df.info()
# Pip install packages
import os, sys
!{sys.executable} -m pip install azure-storage-blob
!{sys.executable} -m pip install pyarrow
!{sys.executable} -m pip install pandas
# Azure storage access info
azure_storage_account_name = "azureopendatastorage"
azure_storage_sas_token = r""
container_name = "holidaydatacontainer"
folder_name = "Processed"
from azure.storage.blob import BlockBlobServicefrom azure.storage.blob import BlobServiceClient, BlobClient, ContainerClient
if azure_storage_account_name is None or azure_storage_sas_token is None:
raise Exception(
"Provide your specific name and key for your Azure Storage account--see the Prerequisites section earlier.")
print('Looking for the first parquet under the folder ' +
folder_name + ' in container "' + container_name + '"...')
container_url = f"https://{azure_storage_account_name}.blob.core.windows.net/"
blob_service_client = BlobServiceClient(
container_url, azure_storage_sas_token if azure_storage_sas_token else None)
container_client = blob_service_client.get_container_client(container_name)
blobs = container_client.list_blobs(folder_name)
sorted_blobs = sorted(list(blobs), key=lambda e: e.name, reverse=True)
targetBlobName = ''
for blob in sorted_blobs:
if blob.name.startswith(folder_name) and blob.name.endswith('.parquet'):
targetBlobName = blob.name
break
print('Target blob to download: ' + targetBlobName)
_, filename = os.path.split(targetBlobName)
blob_client = container_client.get_blob_client(targetBlobName)
with open(filename, 'wb') as local_file:
blob_client.download_blob().download_to_stream(local_file)
# Read the parquet file into Pandas data frame
import pandas as pd
print('Reading the parquet file into Pandas data frame')
df = pd.read_parquet(filename)
# you can add your filter at below
print('Loaded as a Pandas data frame: ')
df
Azure Databricks
# This is a package in preview.
# You need to pip install azureml-opendatasets in Databricks cluster. https://docs.microsoft.com/en-us/azure/data-explorer/connect-from-databricks#install-the-python-library-on-your-azure-databricks-cluster
from azureml.opendatasets import PublicHolidays
from datetime import datetime
from dateutil import parser
from dateutil.relativedelta import relativedelta
end_date = datetime.today()
start_date = datetime.today() - relativedelta(months=1)
hol = PublicHolidays(start_date=start_date, end_date=end_date)
hol_df = hol.to_spark_dataframe()
display(hol_df.limit(5))
# Azure storage access info
blob_account_name = "azureopendatastorage"
blob_container_name = "holidaydatacontainer"
blob_relative_path = "Processed"
blob_sas_token = r""
# Allow SPARK to read from Blob remotely
wasbs_path = 'wasbs://%s@%s.blob.core.windows.net/%s' % (blob_container_name, blob_account_name, blob_relative_path)
spark.conf.set(
'fs.azure.sas.%s.%s.blob.core.windows.net' % (blob_container_name, blob_account_name),
blob_sas_token)
print('Remote blob path: ' + wasbs_path)
# SPARK read parquet, note that it won't load any data yet by now
df = spark.read.parquet(wasbs_path)
print('Register the DataFrame as a SQL temporary view: source')
df.createOrReplaceTempView('source')
# Display top 10 rows
print('Displaying top 10 rows: ')
display(spark.sql('SELECT * FROM source LIMIT 10'))
Azure Synapse
# This is a package in preview.
from azureml.opendatasets import PublicHolidays
from datetime import datetime
from dateutil import parser
from dateutil.relativedelta import relativedelta
end_date = datetime.today()
start_date = datetime.today() - relativedelta(months=1)
hol = PublicHolidays(start_date=start_date, end_date=end_date)
hol_df = hol.to_spark_dataframe()
# Display top 5 rows
display(hol_df.limit(5))
# Azure storage access info
blob_account_name = "azureopendatastorage"
blob_container_name = "holidaydatacontainer"
blob_relative_path = "Processed"
blob_sas_token = r""
# Allow SPARK to read from Blob remotely
wasbs_path = 'wasbs://%s@%s.blob.core.windows.net/%s' % (blob_container_name, blob_account_name, blob_relative_path)
spark.conf.set(
'fs.azure.sas.%s.%s.blob.core.windows.net' % (blob_container_name, blob_account_name),
blob_sas_token)
print('Remote blob path: ' + wasbs_path)
# SPARK read parquet, note that it won't load any data yet by now
df = spark.read.parquet(wasbs_path)
print('Register the DataFrame as a SQL temporary view: source')
df.createOrReplaceTempView('source')
# Display top 10 rows
print('Displaying top 10 rows: ')
display(spark.sql('SELECT * FROM source LIMIT 10'))