santoshlite / Empyrial

An Open Source Portfolio Backtesting Engine for Everyone | 面向所有人的开源投资组合回测引擎
https://empyrial.gitbook.io/empyrial/
MIT License
914 stars 124 forks source link

TypeError: float() argument must be a string or a number, not 'DataFrame' #124

Closed emanuellabat closed 2 months ago

emanuellabat commented 4 months ago

When I run a test code:

from empyrial import empyrial, Engine

portfolio = Engine( start_date = "2018-08-01", portfolio = ["BABA", "PDD", "KO", "AMD","^IXIC"], weights = [0.2, 0.2, 0.2, 0.2, 0.2], # equal weighting is set by default benchmark = ["SPY"] # SPY is set by default )

empyrial(portfolio)

give me a following error:

TypeError: float() argument must be a string or a number, not 'DataFrame'

Captura de pantalla 2024-04-13 a la(s) 1 14 35 p  m

Could anyone to help me with this issue?

Thanks

rokups commented 2 months ago
pip install --upgrade matplotlib
pip install --upgrade quantstats

This fixed it for me. Idk if both need to be updated or just one of them.

santoshlite commented 2 months ago

@emanuellabat did @rokups solution work

emanuellabat commented 2 months ago

Hi, yes I could fix it with @rokups solution. Thanks