update EPU

This commit is contained in:
TerenceLiu98 2023-04-20 20:24:33 +08:00
parent e09a821d69
commit 1f86624b26
1 changed files with 4 additions and 5 deletions

View File

@ -3,9 +3,8 @@ import requests
import pandas as pd
url = {
"EPU-China": "https://economicpolicyuncertaintyinchina.weebly.com",
"EPU-HKSAR": "https://economicpolicyuncertaintyinchina.weebly.com/epu-in-hong-kong.html",
"EPU-MACAUSAR": "https://economicpolicyuncertaintyinchina.weebly.com/epu-in-macao.html",
"EPU-China": "https://www.policyuncertainty.com/media/SCMP_China_Policy_Uncertainty_Data.xlsx",
"EPU-HKSAR": "https://www.policyuncertainty.com/media/HK_EPU_Data_Annotated.xlsx",
"EPU": "https://www.policyuncertainty.com/"
}
@ -52,7 +51,7 @@ class EPUData(object):
output_data.append(pd.read_excel(urls_data[i]))
return {"data":output_data, "reference":urls_cite}
'''
elif self.country == "MACAUSAR":
r = requests.get(url["EPU-MACAUSAR"])
webpage = html.fromstring(r.content)
@ -66,7 +65,7 @@ class EPUData(object):
output_data.append(pd.read_excel(urls_data[i]))
return {"data":output_data, "reference":urls_cite}
'''
else:
r = requests.get(url["EPU"] + self.country.lower() + "_monthly.html")
webpage = html.fromstring(r.content)