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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
3 0 0 0

Obtain TR.CommonName and TR.RIC given a list of companies

I have a list of 1752 private company names. I would like to ask how to extract TR.CommonName and TR.RIC for all of the 1752 companies.

I use the following code to obtain TR.CommonName and TR.RIC for Jetstar

df, err = ek.get_data([SCREEN(U(IN(Private(OrgType(COM,UNK,MKP)))),Contains(TR.CommonName, Jetstar))], [TR.CommonName,TR.RIC])

when I try to apply the code to a list of company names like following, I notice that eikon search for companies with names that contains the character "company_list [x]", instead of the value that company_list [x] refers to.

for x in company_list[0,1751]

df_1 = df

df_2, err = ek.get_data(['SCREEN(U(IN(Private(OrgType(COM,UNK,MKP)))),Contains(TR.CommonName,company_list [x]))'], ['TR.CommonName','TR.RIC'])

df_2["MerchantName"] = company_list [x]

df_merged = pd.concat([df_1,df_2],ignore_index = True)

df = df_merged


Thank you very much.

eikoneikon-data-apiricscompanypython api
icon clock
10 |1500

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

1 Answer

Upvotes
Accepted
11.5k 16 7 10

Hello @songqirong

Do you mean the Eikon Screener search for the company with "company_list[x]" string instead of the value of the company_list[x] variable?

If so, you need to concat the actual value of the company_list[x] variable to the Screener query string.

for x in company_list:
    screen = 'SCREEN(U(IN(Private(OrgType(COM,UNK,MKP)))),Contains(TR.CommonName, {})'.format(x)
    print(screen)

concat-string-screener.png


You can find more details from the following Python resources:


icon clock
10 |1500

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

Click below to post an Idea Post Idea