I'd like to request the constituents of an index via:
df, err = ek.get_data('.SPX', ['TR.IndexConstituentRIC', 'TR.IndexConstituentWeightPercent'])
However the weight fileds don't contain any value:
>>> df Instrument Constituent RIC Weight percent 0 .SPX POOL.OQ <NA> 1 .SPX CHRW.OQ <NA> 2 .SPX AJG.N <NA> 3 .SPX CNP.N <NA> 4 .SPX AMCR.N <NA> .. ... ... ... 500 .SPX DXC.N <NA> 501 .SPX SNPS.OQ <NA> 502 .SPX J.N <NA> 503 .SPX SIVB.OQ <NA> 504 .SPX AVY.N <NA> [505 rows x 3 columns]
Furthermore I get this error for every single row in the result:
>>> len(err) 505 >>> err[0] {'code': 415, 'col': 2, 'message': 'Unable to collect data for some field(s).', 'row': 0}
My overall goal is to request the TRBC sector weights of an index, so if there is another way to directly request the sector weights (rather than manually computing them via constituents) that would solve my problem as well.
I've noticed that another person in 2018 had quite a similar problem (see https://community.developers.refinitiv.com/questions/23018/eikon-data-api-trindexconstituentweightpercent-thr.html), hoewever it is not clear what solved the issue back then.