I am trying the below Python code to get price index for 50 securities, but it seems the the call is failing because some of the securities do not have history from the starting date, and hence failing to rebalance to 100; one example being UKBJK28Z9. Could you please help me figure this out? The error message Jupyter Notebook is showing is "
could not broadcast input array from shape (3) into shape (50)
"
-----------------------------------------------------------------------------------------------------------------
num_of_sedol_in_each_set = 45
str_fields = 'REB#(X(PI)~U$)'
char_freq = 'M'
first_day_str = '2019-04-16'
last_day_str = '2021-04-15'
isinlist = ['UKBW9RTW0', 'UK6718976', 'UKB01FLR7', 'UK6706250', 'UK6264048', 'UKB2Q5H56', 'UKB4TX8S1', 'UKB1JKTQ6', 'UKB297KM7', 'UKB2PFVH7', 'UKB0BM5T8', 'UKB2R2ZC9', 'UKB1L3XL6', 'UKBYYDFN0', 'UKB1R0FF9', 'UK6241483', 'UKB55ZBQ7', 'UKBF16M83', 'UK6247726', 'UKBD6FLL7', 'UKBJ0RTH3', 'UKBMC5RM7', 'UKBJVJP36', 'UKBLLJ4H7', 'UKB27WRM3', 'UK2579230', 'UK2606440', 'UKB00PV12', 'UKBF2HB11', 'UKBMMV2K8', 'UKB2NR3Y6', 'UK6465874', 'UKB5B23W2', 'UKB4JSTL6', 'UKB4P8HQ1', 'UKB1KYHF2', 'UKBSS6HX7', 'UKB02TT74', 'UKBLD9KX3', 'UKB0FXT17', 'UKBFNLRN6', 'UKBM67GG6', 'UKBYP71J9', 'UKBF4NQP6', 'UKBHHD4Q4', 'UKBYYNH90', 'UKBGJW376', 'UKBF3B6J5', 'UK2579230', 'UKBJK28Z9']
df_prices = pd.DataFrame()
df_prices = ds.fetch(tickers=isinlist, fields=[str_fields], \
date_from= first_day_str, date_to= last_day_str, freq= char_freq)
df_prices