Skip to content

ValueError: attempt to get argmin of an empty sequence #54

@fishingcatgo

Description

@fishingcatgo

C:\MyApp\miniconda3\envs\py12\Lib\site-packages\pyfolio\pos.py:25: UserWarning: Module "zipline.assets" not found; multipliers will not be applied to position notionals.
warnings.warn(
[100%**] 1 of 1 completed

1 Failed download:
['FB']: YFTzMissingError('$%ticker%: possibly delisted; no timezone found')
<IPython.core.display.HTML object>
Traceback (most recent call last):
File "C:\Users\16343\Desktop\vspro\quantify1\pyfolio_1.py", line 17, in
pf.create_returns_tear_sheet(stock_rets, live_start_date='2015-12-1')
File "C:\MyApp\miniconda3\envs\py12\Lib\site-packages\pyfolio\plotting.py", line 51, in call_w_context
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "C:\MyApp\miniconda3\envs\py12\Lib\site-packages\pyfolio\tears.py", line 538, in create_returns_tear_sheet
plotting.show_worst_drawdown_periods(returns)
File "C:\MyApp\miniconda3\envs\py12\Lib\site-packages\pyfolio\plotting.py", line 1782, in show_worst_drawdown_periods
drawdown_df = timeseries.gen_drawdown_table(returns, top=top)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\MyApp\miniconda3\envs\py12\Lib\site-packages\pyfolio\timeseries.py", line 991, in gen_drawdown_table
drawdown_periods = get_top_drawdowns(returns, top=top)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\MyApp\miniconda3\envs\py12\Lib\site-packages\pyfolio\timeseries.py", line 957, in get_top_drawdowns
peak, valley, recovery = get_max_drawdown_underwater(underwater)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\MyApp\miniconda3\envs\py12\Lib\site-packages\pyfolio\timeseries.py", line 894, in get_max_drawdown_underwater
valley = underwater.idxmin() # end of the period
^^^^^^^^^^^^^^^^^^^
File "C:\MyApp\miniconda3\envs\py12\Lib\site-packages\pandas\core\series.py", line 2677, in idxmin
i = self.argmin(axis, skipna, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\MyApp\miniconda3\envs\py12\Lib\site-packages\pandas\core\base.py", line 785, in argmin
result = nanops.nanargmin(delegate, skipna=skipna)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\MyApp\miniconda3\envs\py12\Lib\site-packages\pandas\core\nanops.py", line 1194, in nanargmin
result = values.argmin(axis)
^^^^^^^^^^^^^^^^^^^
ValueError: attempt to get argmin of an empty sequence

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions