pyfolio icon indicating copy to clipboard operation
pyfolio copied to clipboard

Index naming error in capacity.py

Open sokol11 opened this issue 4 years ago • 0 comments

Running .create_capacity_tear_sheet() raises an index naming error in capacity.py.

The following lines inside get_max_days_to_liquidate_by_ticker() are causing the error:

liq_desc.index.levels[0].name = 'symbol'
liq_desc.index.levels[1].name = 'date'

I am guessing the error is due to this syntax being no longer supported in pandas. Replacing the above with liq_desc.index.names = ['symbol', 'date'] seems to solve the problem.

I wish I knew how to formally test this and submit a pull request but I don't.

sokol11 avatar May 02 '20 00:05 sokol11