robertmartin8 / PyPortfolioOpt

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

Add check to `market_prices` #467

Closed duranvrNubank closed 1 year ago

duranvrNubank commented 2 years ago

The method expected_returns.capm_returns() fails if you provide a Series as market_prices. I added a similar check to the one that is done in the prices argument and transformed it into a dataframe. It should fix it.