Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • Eikon Data APIs /
avatar image
Question by davidk · Jan 29, 2019 at 06:45 PM · python apieikon data apinanmultiple_ricsmissing

NaN in Python CUSIP query when asking for multiple securities; returns correctly with one security

Very bizarre behavior-- data which is showing up as NaN when requested with multiple securities, is showing up as valid when requested one security at a time. More oddly, if the multiple securities request is rerun after a single-security request, any securities singly-requested then have non-NaN values.

Reproduction instructions:

Suppose I set rics to a list of rics:

rics = [u'GLT', u'GLW', u'GATX.K', u'NEO.O', u'GNTX.O', u'CORT.O', u'COLM.O', u'GPC', u'GPS', u'MRC', u'CASH.O', u'GRC', u'GT.O', u'ZBH', u'LBAI.O', u'ROCK.O', u'IAC.O', u'GWW', u'AJRD.K', u'KAI', u'UBSH.O', u'HAL', u'BECN.O', u'HAS.O', u'HRC', u'RDWR.O', u'HB AN.O', u'ARNA.O', u'PTEN.O', u'ALLT.O', u'DECK.K', u'WELL.K', u'HCP', u'HCSG.O', u'BEL', u'HD', u'HOG', u'HE', u'UFPI.O', u'HEI', u'SCHN.O', u'HELE.O', u'MOV', u'LXP', u'CHK', u'REG.O', u'CSEAF.PK', u'HL']

Consider the following base request:

In[19:] data, err = ek.get_data(rics, ['TR.CUSIPCode', 'TR.CinCUSIPCode'])

In the response to this first call, I get all NaN for every RIC:

In [20]: print data

NaN TR.CUSIPCODE TR.CINCUSIPCODE

0 GLT NaN NaN

1 GLW NaN NaN

2 GATX.K NaN NaN

...

46 CSEAF.PK NaN NaN

47 HL NaN NaN

In the second call, I request just the first RIC, and find a valid CUSIP for it:

In [21]: data, err = ek.get_data(rics[0], data_field)

In [22]: print data

Instrument CUSIP Code CIN

0 GLT 377316104 NaN

Note that requesting RIC GLT alone makes it non-NaN, even though in the multi-RIC request it was NaN.

Then if I immediately re-request all the RICs-- now GLT has a valid CUSIP code but none of the other RICs do:

In [23]: data, err = ek.get_data(rics, data_field)

In [24]: print data

Instrument CUSIP Code CIN

0 GLT 377316104.0 NaN

1 GLW NaN NaN

2 GATX.K NaN NaN

...

46 CSEAF.PK NaN NaN

47 HL NaN NaN

This seems really strange, and I have confirmed that it occurs on both pyeikon 0.1.13 and 1.0.0.

Any ideas what is going on here?

People who like this

0 Show 0
Comment
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

1 Reply

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by Zhenya Kovalyov · Jan 30, 2019 at 06:02 AM

@davidk that's a backend oddity which seems like a bug. Here is a workaround, which is not ideal though:

  1. Use TR.CUSIPExtended instead of both CUSIP and CIN, as it is designed to always return a value;
  2. Do smaller batch requests, for instance, 10 at a time
df, err = ek.get_data(rics[:10], ['TR.CUSIPExtended'])

In the meantime, I will report it to the dev.

Comment

People who like this

0 Show 3 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

avatar image
davidk · Jan 30, 2019 at 09:58 AM 0
Share

Thanks, we will use the CUSIPExtended field.

As for batching-- Any general rule as to what limit to use? We're quants who often ask for data fields for 1000-2000 securities. Limiting requests even for a single field to batches of 10 (or 1, the only thing we've found consistently works recently) really hampers the performance of the Python API. I know there are data limits associated with each API request IIRC they were orders of magnitude higher than this.

avatar image
REFINITIV
Zhenya Kovalyov ♦♦ davidk · Jan 31, 2019 at 04:46 AM 0
Share

@davidk the causes are being investigated. I suggested batching this specific request as a workaround, so you should be fine in other cases, API will tell you when the per request limit is hit.

Another optimization technique for you, until we finish investigating it, would be to use the symbology API to convert RIC to CUSIP, and in a separate call look for the CIN for the tickers that do not have a CUSIP:

df = ek.get_symbology(rics, from_symbol_type='RIC', to_symbol_type='CUSIP')
cin_rics = df[df['CUSIP'].isnull()].index.tolist()
cin_df, err = ek.get_data(cin_rics, ['TR.CUSIPExtended']
avatar image
REFINITIV
Zhenya Kovalyov ♦♦ Zhenya Kovalyov ♦♦ · Jan 31, 2019 at 04:47 AM 0
Share

@davidk does the job in two requests.

Watch this question

Add to watch list
Add to your watch list to receive emailed updates for this question. Too many emails? Change your settings >
10 People are following this question.

Related Questions

How can I access the Eikon Data API using Python on macOS?

Error code 429 | Client Error: Too Many Requests - Too many requests, please try again later

Is it possible to search for all Equities listed on a particular exchange using the Eikon.get_data() function?

What version of Eikon (Core, Research and Advisory, Premium) do you need to use the Python Data APIs?

EikonError: Error code 408 | UDF timeout occured. The operation was canceled.

  • Feedback
  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Careers
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Calais
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • Refinitiv Data Platform
    • Refinitiv Data Platform Libraries
  • Rose's Space
  • Screening
    • Qual-ID API
    • Screening Deployed
    • Screening Online
    • World-Check One
    • World-Check One Zero Footprint
  • Side by Side Integration API
  • TR Knowledge Graph
  • TREP APIs
    • CAT
    • DACS Station
    • Open DACS
    • RFA
    • UPA
  • TREP Infrastructure
  • TRIT
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • World-Check Data File
  • Explore
  • Tags
  • Questions
  • Badges