Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

TypeError: download() got an unexpected keyword argument 'multi_level_index' #392

Open
JomaDeveloper opened this issue Dec 20, 2024 · 1 comment

Comments

@JomaDeveloper
Copy link

I try

qs.reports.html(algo_data, 'QQQ', title=f'BrokerAccountId: {brokerAccountUniqueId}',
                output=f'{brokerAccountUniqueId}.html',
                download_filename=f'{brokerAccountUniqueId}_Report.html')

and get this error

TypeError Traceback (most recent call last)
Cell In [5], line 2
1 #qs.reports.full(algo_data, 'QQQ',)
----> 2 qs.reports.html(algo_data, 'QQQ', title=f'BrokerAccountId: {brokerAccountUniqueId}',
3 output=f'{brokerAccountUniqueId}.html',
4 download_filename=f'{brokerAccountUniqueId}_Report.html')

File d:\Python_Projects\Tickeron_Selector\venv\lib\site-packages\quantstats\reports.py:106, in html(returns, benchmark, rf, grayscale, title, output, compounded, periods_per_year, download_filename, figfmt, template_path, match_dates, **kwargs)
101 benchmark_title = benchmark[benchmark.columns[0]].name
103 tpl = tpl.replace(
104 "{{benchmark_title}}", f"Benchmark is {benchmark_title.upper()} | "
105 )
--> 106 benchmark = _utils._prepare_benchmark(benchmark, returns.index, rf)
107 if match_dates is True:
108 returns, benchmark = _match_dates(returns, benchmark)

File d:\Python_Projects\Tickeron_Selector\venv\lib\site-packages\quantstats\utils.py:266, in _prepare_benchmark(benchmark, period, rf, prepare_returns)
263 return None
265 if isinstance(benchmark, str):
--> 266 benchmark = download_returns(benchmark)
268 elif isinstance(benchmark, _pd.DataFrame):
269 benchmark = benchmark[benchmark.columns[0]].copy()

File d:\Python_Projects\Tickeron_Selector\venv\lib\site-packages\quantstats\utils.py:250, in download_returns(ticker, period, proxy)
...
--> 104 result = func(*args, **kwargs)
106 logger.debug(f'Exiting {func.name}()')
107 return result

TypeError: download() got an unexpected keyword argument 'multi_level_index'

@UrielSC26
Copy link

I have the same issue, the code is:

`import quantstats as qs

qs.extend_pandas()

tickers = {'AMZN': 0.5, 'META': 0.5}

portfolio = qs.utils.make_index(tickers)

qs.reports.html(fmaga, 'SPY', output='output/fmaga_vs_SPY.html')`

and the error is

download() got an unexpected keyword argument 'multi_level_index'
File "/Users/urielsantillan/Documents/Leirus Capital/Portafolio.py", line 7, in
portfolio = qs.utils.make_index(tickers)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: download() got an unexpected keyword argument 'multi_level_index'

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants