santoshlite / EigenLedger

An Open Source Portfolio Backtesting Engine for Everyone | 面向所有人的开源投资组合回测引擎
https://eigenledger.gitbook.io/documentation
Apache License 2.0
949 stars 128 forks source link

Error when running fundlens #19

Closed jaredre closed 3 years ago

jaredre commented 3 years ago

Anaconda3\lib\site-packages\empyrial.py", line 610, in fundlens ['Dividend yield', yahoo_financials.get_dividend_yield()], ['Payout ratio', yahoo_financials.get_payout_ratio()], ['Controversy', controversy], ['Social score', social_score],

UnboundLocalError: local variable 'controversy' referenced before assignment

santoshlite commented 3 years ago

I think there was an error in my code, thanks for raising that :)

Try to do

pip uninstall empyrial

and

pip install empyrial

It'd install the new version and it should work. Keep me posted!

jaredre commented 3 years ago

Thanks for the help.

Unfortunately this error now appears.

~\Anaconda3\lib\site-packages\empyrial.py in fundlens(my_portfolio, period) 588 589 try: --> 590 controversy = ticker.sustainability.iloc[:,0]['highestControversy'] 591 except TypeError: 592 controversy = "None"

AttributeError: 'NoneType' object has no attribute 'iloc'

santoshlite commented 3 years ago

Again this is my mistake 💀

Try to reinstall it now, hopefully, this should work. If you still get an error can you show me the tickers you try to pass through the fundlens, please?

It'll help me to copy your code and see where the problem is.

Have a good day =)

jaredre commented 3 years ago

Hi,

Works great. Thanks for the help.