
* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.
def add_company(code):
company = yf.Ticker(code)
name = company.info['shortName']
industry = company.info['industry']
marketcap = company.info['marketCap']
summary = company.info['longBusinessSummary']
currentprice = company.info['currentPrice']
targetprice = company.info['targetMeanPrice']
per = company.info['trailingPE']
eps = company.info['trailingEps']
pbr = company.info['priceToBook']
rev2021 = company.earnings.iloc[-1,0]
rev2020 = company.earnings.iloc[-2,0]
rev2019 = company.earnings.iloc[-3,0]
ear2021 = company.earnings.iloc[-1,1]
ear2020 = company.earnings.iloc[-2,1]
ear2019 = company.earnings.iloc[-3,1]
doc = {
'name':name,
'industry':industry,
'marketcap':marketcap,
'summary':summary,
'currentprice':currentprice,
'targetprice':targetprice,
'per':per,
'eps':eps,
'pbr':pbr,
'rev2021':rev2021,
'rev2020':rev2020,
'rev2019':rev2019,
'ear2021':ear2021,
'ear2020':ear2020,
'ear2019':ear2019
}
return doc
return에서 오류가 발생하네요...

