I want to use pipeline to rank securities by a custom factor but I want to limit the rank to a hand picked list of 27 securities.
When I run the code, I get "TypeError: unhashable type: 'list'." I understand that the list I'm using isn't formatted properly for the masking function to work but I don't know how to transform it.
Here is a sample of my code
discount=Discount() pipe.add(discount, 'disc') set_symbol_lookup_date('2016-07-24') loans = symbols('AFT', 'ARDC', 'ACP', 'BHL', 'FRA', 'BGT', 'BSL', 'BGX', 'BGB', 'EFT', 'EFF', 'EFR', 'EVF','ECC', 'FCT', 'VVR', 'VTA', 'JQC', 'JRO', 'JFR', 'NSL', 'JSD', 'OXLC', 'PHD', 'TSLF', 'PPR', 'TLI') discount_rank = discount.rank(mask=loans) pipe.add(discount_rank, 'disc_rank')
The error stems from setting mask equal to a list of securities.
I'm new to python and I'd appreciate any help with this.