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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
43 3 4 6

Issue with get_data returning multiple rows for one single investor

Hello, I want to get a field called TR.InvestorType using Python. I noticed that when I do:

data, err = ek.get_data(["5000001154","4295955751"], TR.InvestorType, {CURN: USD})

I get the right results. Then when I add for example the ID 4295895691:

data, err = ek.get_data(["5000001154","4295955751","4295895691"], TR.InvestorType, {CURN: USD})

then I get multiple rows for 4295895691 and I don't get the results for the first two companies anymore. Anyone has an idea on why I am getting this behavior?

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpythonapi
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.

Upvotes
Accepted
18k 21 12 20

Hi @charles.malafosse

- can you fix this so we don't have to do all this extra work to get correct data?

I believe that the data is correct. It is possible to have multiple investors.

There are multiple investors to the "4295895691" identifier.


- How can I get only one row returned (the most recent or the populated investor type data for ID 4295895691)

You can use "Data Item Browser" to explore the supported parameters on TR.InvestorType field.

In this case, you can set "End Number" to 1 so you would only get the first row in the result.

- Why these IDs return different data sets? Is it because one is listed and the others are not? How can we separate the two types?

I believe that the data is correct. It is possible to have multiple investors.

If you need further clarification on the content, you can contact Refinitiv Content Helpdesk at https://my.refinitiv.com/

Helpdesk would be able to suggest if there are any fields to allow you to separate them.


ahs1.png (29.2 KiB)
ahs2.png (94.0 KiB)
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.

Upvotes
23k 22 9 14

Hello @charles.malafosse,

As I was able to confirm by running Eikon search on these instruments,

Some Permids (the identifiers you request by is permid) map to one RIC,, some to none ( the first two, they are "unlisted"), some to many such as the third, Alliance Trust.

Suggest to try this request to see this difference in action

data, err = ek.get_data(["5000001154","4295955751","4295895691"],  ['TR.InvestorType', 'TR.CommonName','TR.CompanyName'])

For me this results in

It appears, that you are looking for results that correspond to a listed RIC.


comps-20200602.gif (27.4 KiB)
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.

Hi @charles.malafosse

Just want to make the result more obvious.

This is the sample code:

data, err = ek.get_data(["5000001154","4295955751","4295895691"],
                        ['TR.InvestorType.instrument', 'TR.InvestorType.investorid', 'TR.InvestorType',
                         'TR.CommonName.instrument', 'TR.CommonName',
                         'TR.CompanyName.instrument', 'TR.CompanyName'])
data.head(10)

The multiple records are acutually from different investor ids.

ahs.png (255.5 KiB)
Upvotes
9.7k 49 38 60

Hi @charles.malafosse,

As @zoya.farberov pointed out and as you observed, the 3rd PermID ("4295895691") does have multiple (~185 rows) returned. If you only want the InvestorType for both, I think you will have to merge the results. It appears the get_data() doesn't understand how to merge these 2 different data sets into one.

For example:

df1,err = ek.get_data(["5000001154","4295955751"], "TR.InvestorType")
df1
df2, err = ek.get_data(["4295895691"],  ['TR.InvestorType'])
df2
df = pd.concat([df1, df2])
df


ahs.png (10.9 KiB)
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.

Upvotes
43 3 4 6

@nick.zincone.1 @zoya.farberov @chavalit.jintamalit

Hi all, thanks for your answers. I have a couple of questions:

- can you fix this so we don't have to do all this extra work to get correct data?

- How can I get only only one row returned (the most recent or the populated investor type data for ID 4295895691)

- Why these IDs return different data sets? Is it because one is listed and the others are not? How can we separate the two types?

Thanks

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.

Upvotes
23k 22 9 14

@charles.malafosse,

Try selecting by value

data, err = ek.get_data(["5000001154","4295955751","4295895691"],  ['TR.InvestorType', 'TR.CommonName','TR.CompanyName'])
data.loc[data['Company Common Name'] != '']


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.

Upvotes
43 3 4 6

Hi @chavalit.jintamalit,

Going back to this issue, when I add the parameter you suggested:

parameters={"CURN": "USD","EndNum":1}
data, err = ek.get_data(["5000001154","4295955751","4295895691"], "TR.InvestorType", parameters)

I get:

   Instrument      Investor Type Description
0  5000001154                               
1  4295955751                               
2  4295895691  Investment Advisor/Hedge Fund

So this didn't resolve my problem that the first 2 investors types were missing. Please note I don't want to do one request per investor as I have thousands of them so this would take too much time.

thanks



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.

Hi @charles.malafosse

I think the backend may try to request data as "RIC" type.

So please separate your identifiers into 2 groups.


ahs.png (40.3 KiB)

Hi @chavalit.jintamalit, that is a very strange behavior. Is that normal? How do I know which code is understood as RIC? If I submit a permid, why would it match on RIC?

Hi @charles.malafosse

I believe that this is a deficiency in this specific backend component that serves this data.

The input Perm ID you have, some of them cannot be mapped to RIC code.

Here is the result when you mixed them on both Eikon Data API and Eikon Excel(same behavior):


Here is to be more precise, the code explicitly set the instrument type and still the same behavior:

So the workaround is to try to map PermID to RIC code first.

Then divide the instruments into 2 lists as suggested earlier.

ahs.png (173.1 KiB)
ahs2.png (73.4 KiB)
Upvotes
43 3 4 6

Hi @chavalit.jintamalit,

thanks for your answer but wouldn't it be easier if you just fix the deficiency?

Best

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.

Hi @charles.malafosse

I have raised a ticket 08965493 on your behalf to Refinitiv Helpdesk.

They will contact you regarding this case.
Click below to post an Idea Post Idea