robertmartin8 / PyPortfolioOpt

Financial portfolio optimisation in python, including classical efficient frontier, Black-Litterman, Hierarchical Risk Parity
https://pyportfolioopt.readthedocs.io/
MIT License
4.39k stars 940 forks source link

typo in Quick example section? #319

Closed omendezmorales closed 3 years ago

omendezmorales commented 3 years ago

What are you trying to do? In the quick example section, calling da = DiscreteAllocation(cleaned_weights, latest_prices, total_portfolio_value=10000) retrieves "NameError: name 'weights' is not defined" What have you tried? I believe given the variable used previously, it should be cleaned_weights?

What data are you using? I am using the following dataset ("tests/resources/stock_prices.csv") as provided in the repo, and executing the sample code in a ipython environment

Thanks for your help.

phschiele commented 3 years ago

Good catch, indeed, using cleaned_weights works. @robertmartin8, I have changed it here: #320

robertmartin8 commented 3 years ago

Cheers, fixed!