quantstats icon indicating copy to clipboard operation
quantstats copied to clipboard

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

Open JomaDeveloper opened this issue 1 year ago • 1 comments

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'

JomaDeveloper avatar Dec 20 '24 08:12 JomaDeveloper

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'

UrielSC26 avatar Jan 28 '25 19:01 UrielSC26

Closing this issue as it's older than 2025 and the yfinance compatibility issues have been resolved in release 0.0.64 with the implementation of safe_yfinance_download function that handles proxy configuration changes.

ranaroussi avatar Jul 18 '25 14:07 ranaroussi