Why does ek.get_data sometimes return all NaN-values if certain columns included?
I am currently collecting data of all constituents of the CDAX index. If requesting fields like Close Price, Company Market Cap etc., then every time data is received, it is correct, including values, correct column names etc.
When I added different fields like for example Percent Held by Strategic Entities (InstrPctHldStrategic) then if long timeranges are requested, nearly all of the time the data has all NaN-values. Even for the columns that were previously received without any issues. Additionally the column names do not have their 'normal-language' names (TR.CLOSEPRICE -> Close Price), but are all named with the field-parameter names (TR.CLOSEPRICE etc.).
I tested this on many timeframes. For short ones (one year, monthly data) there is quite a high chance that the response will be correct.
For longer timeframes I could not get one single correct answer. My guess first was, that data for fields like InstrPctHldStrategic is not available for the requested timeframe, and therefore such error occurs, but testing on short timeframes, I saw, that one request could result in a correct answer, but sending the same exact request 2 min later, results in a wrong answer again.
My second guess would be server issues. Are there currently any problems?
Checkout the code which resulted in mostly bad formed results:
symbols = ek.get_data(self.index_chain, 'TR.RIC')[0]['RIC'].tolist()
df = ek.get_data(symbols,
fields = ['TR.CLOSEPRICE.date', 'TR.CLOSEPRICE', 'TR.CompanyMarketCap', 'TR.InstrPctHldStrategic', 'TR.FreeFloatPct'],
{'SDate': '2015-11-30', 'EDate': '2020-11-30', 'Frq': 'AM'})[0]
return:
0 TR.CLOSEPRICE.DATE TR.CLOSEPRICE TR.COMPANYMARKETCAP TR.INSTRPCTHLDSTRATEGIC TR.FREEFLOATPCT
0 GSC1n.DE <NA> <NA> <NA> <NA> <NA>
1 ELBG.DE <NA> <NA> <NA> <NA> <NA>
2 DICn.DE <NA> <NA> <NA> <NA> <NA>
3 TLIk.DE <NA> <NA> <NA> <NA> <NA>
4 SZUG.DE <NA> <NA> <NA> <NA> <NA>
.. ... ... ... ... ... ...
402 MSHGn.F <NA> <NA> <NA> <NA> <NA>
403 IFXGn.DE <NA> <NA> <NA> <NA> <NA>
404 COP1n.DE <NA> <NA> <NA> <NA> <NA>
405 AOXG.DE <NA> <NA> <NA> <NA> <NA>
406 FKEK.F <NA> <NA> <NA> <NA> <NA>
Format of correct return (achieved with same request for different timeframe):
Instrument Date Close Price Company Market Cap Percent of Shares Held by Strategic Entities Free Float (Percent)
0 GSC1n.DE 2019-12-30T00:00:00Z 18.86 2.009643e+08 13.7117 71.8883
1 GSC1n.DE 2020-01-31T00:00:00Z 19.00 2.044330e+08 13.7117 71.8883
2 GSC1n.DE 2020-02-28T00:00:00Z 18.78 2.072512e+08 13.7117 71.8883
3 GSC1n.DE 2020-03-31T00:00:00Z 13.66 2.035658e+08 13.7117 71.8883
4 GSC1n.DE 2020-04-30T00:00:00Z 15.55 1.452493e+08 13.7117 71.8883
... ... ... ... ... ... ...
Best Answer
-
Hi @home_eikon2
I think it may relate to the limitation.
Please review this API limitation guideline at https://developers.refinitiv.com/en/api-catalog/eikon/eikon-data-api/documentation
I tested the same API call with the same period but only a few instrument codes and it works fine.
0
Categories
- All Categories
- 6 AHS
- 39 Alpha
- 162 App Studio
- 4 Block Chain
- 5 Bot Platform
- 17 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 370 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 60 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛