For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 1 0 3

Getting no entries in dataframe using screener exp in get_data in python

Hi,

I am currently trying to obtain metrics of non financial companies in certain countries using suggested code in the forum:

import eikon as ek
ek.set_app_key(app_key)

rics = ('SCREEN(U(IN(Equity(active,public,primary))/*UNV:Public*/),'

    'IN(TR.HQCountryCode,"AR,BR,CL,CN,HU,IN,ID,MY,MX,PL,RU,ZA,KR,TH,TR"),'

    'NOT_IN(TR.GICSIndustryCode,"401010","401020","402010",'

    '"402020","402030","402040","403010")') 

fields = ["TR.CommonName", "TR.HeadquartersCountry", "TR.GICSSector"]

data, error = ek.get_data(rics, fields)

list2 = list(data['Instrument'])

field2 = ["TR.CashandEquivalents.periodenddate","TR.CashandEquivalents"]

for i in range(1, len(data), 10):

    data2, error = ek.get_data(list2[(i-1)*10:i*10], field2, 

        parameters={"SDate": "0", "EDate": "-9", "Scale": "6",

        "Period": "FY0", "Frq": "FQ", "CURN": "USD"})
but i did not get any entry in data. I tried with one country but the result is same. It gives me no entries in the dataframe. Also as a result it gives me a KeyError: 'Instrument' as there is no Instrument column.



eikoneikon-data-apipythonworkspacerefinitiv-dataplatform-eikonworkspace-data-apiscreener
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Upvotes
Accepted
39.3k 76 11 27

The screener expression is missing a closing parenthesis. See corrected code sample on this thread, and also these comments.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.