Why do I get only N/A in the following code in Python?

import refinitiv.dataplatform.eikon as ek
import numpy as np # NumPy
import pandas as pd # pandas
import configparser as cp
import sys
ek.set_app_key('') # here I insert app_key
import eikon as ek
df_xls = pd.read_excel(r'C:\10K.xlsx')
mylist = df_xls['RIC'].tolist()
#print(mylist)
df, err = ek.get_data(
instruments = mylist,
fields = ['MEDIAN(TR.PtoEPSMeanEst(Period=NTM,Frq=W,SDate=2016-12-15,EDate=2021-12-14))']
)
display(df)
Below you could see the result of the script:
Best Answer
-
Hi @susskaya.anita , @malashenko.i.o , @gabriel.g and @rombout
I have been advised by the Eikon Data API team that this issue has been fixed and passed their internal testing with 3000 RICS.
Please test and confirm. Thank you for your patience.
0
Answers
-
I used the code you provided and can get the data properly
Could you please try to print an error of get_data function using print(err) ?
This could be the case that you don't have an access to this data, if so, please contact your account owner regarding the entitlement or if it's any other issue, you may put the error message here and we will investigate more.
0 -
[{'code': 100, 'col': 1, 'message': 'Asynchronous Query library internal error.', 'row': 0}, {'code': 100, 'col': 1, 'message': 'Asynchronous Query library internal error.', 'row': 1},...
it is the error
0 -
It seems that it does not uderstand properly the values from xls. I don't know why.
0 -
0
-
Your XLS filename suggests you have 10K instruments in the list. If this is the case, have you tried with a smaller list of instruments in an excel file?
If you have tried a smaller list and it still fails, please convert the shorter excel file to a CSV file and attach it here so the above code snippet can be tested with your list.
0 -
0
-
The following page explains the various types of limits enforced with the Eikon Data API
Eikon Data API Usage and Limits Guideline
0 -
get_data: The current limit value (10-Oct-2019) is around 10,000 data points.
But I did not exceed that limit. Moreover, I did not have errors which are mentioned in the guideline
0 -
raksina.samasiri, I have the same issue starting this week and I had some research. This issue reproduces time from time and possibility depends on the amount of data.
The code:for RIC_num in [10,100,500]:
for n_cols in [10, 20]:
RIC_list = ric.RIC.tolist()[:RIC_num]
columns = columns_list[:n_cols]
print('RIC length:', len(RIC_list))
print('columns length:', len(columns))
for i_ in range(10):
data, err = ek.get_data(RIC_list, columns)
if err is None:
print('No error', datetime.now())
else:
print(set([e['code'] for e in err]), end=' ')
if 100 in set([e['code'] for e in err]):
print('<--- This error!', datetime.now())
else:
print(datetime.now())
The output (partly):RIC length: 100
columns length: 20
{251658243} 2021-12-16 17:47:00.936565
{251658243} 2021-12-16 17:47:08.035268
{100} <--- This error! 2021-12-16 17:47:30.244498
{100} <--- This error! 2021-12-16 17:47:50.696324
{251658243} 2021-12-16 17:47:57.530822
{251658243} 2021-12-16 17:48:05.015905
{100} <--- This error! 2021-12-16 17:48:40.422272
{251658243} 2021-12-16 17:48:50.582018
{251658243} 2021-12-16 17:48:58.884504
{251658243} 2021-12-16 17:49:08.098476
Here you can see 3 fails for 100 RICs and 20 columns.
In case of 500 RICs with 20 columns it fails in 8 out of 10 attempts:RIC length: 500
columns length: 20
{100} <--- This error! 2021-12-16 17:50:49.137280
{100} <--- This error! 2021-12-16 17:51:10.376004
{251658243} 2021-12-16 17:51:32.593595
{251658243} 2021-12-16 17:51:55.249686
{100} <--- This error! 2021-12-16 17:52:16.634033
{100} <--- This error! 2021-12-16 17:52:37.690012
{100} <--- This error! 2021-12-16 17:52:58.664758
{100} <--- This error! 2021-12-16 17:53:19.581651
{100} <--- This error! 2021-12-16 17:53:40.567594
{251658243} 2021-12-16 17:54:03.253674
I used to work with 3000 rows and it worked fine till before.0 -
I have reported this issue to the Eikon Data API team for their input.
I will report back once I hear from them.
0 -
0
-
Hi @susskaya.anita and @malashenko.i.o
The EDAPI team have asked if you can generate logs?
import logging
ek.set_log_level(logging.DEBUG)
ek.set_app_key('your app key')and then running your script should generate a file something like pyeikon.20211217.15-28-56.log
please remove any credential information from the log file - before uploading.
e.g.
headers = {'x-tr-applicationid': 'your appkey'}
and
access_token":"eyJhbGciOiJIUzI1NiIsInR.......'
NOTE: There may well be multiple entries like the above in your log file
please search and remove all of them before uploading.
0 -
@malashenko.i.o - thanks will pass this on.Hi0
-
I am experiencing similar issues.
Snippets that worked without any problems for years keep throwing this error when calling ek.get_data:
Error code 100 | Asynchronous Query library internal error.
As far as I can tell the problems started on December 10th.
Lowering the number of instruments/fields seems to reduce the error rate. However, even when using moderately sized requests the mentioned error occurs occasionally.
0 -
the same error I usually see
0 -
-
Hi @susskaya.anita , @malashenko.i.o and @gabriel.g
I have copied your messages and log files to the Eikon API team.
I will update once I hear from them.
0 -
0
-
Thank you so much for raising a ticket for me!
0 -
I checked the script using 1500 RICs and get NA as well. Tried the same with TR.PtoEPSMeanEst only and get all results.
My assumption is that for MEDIAN(TR.PtoEPSMeanEst(Period=NTM,Frq=W,SDate=2016-12-15,EDate=2021-12-14)) calculation, python needs to get all data points to calculate MEDIAN, so 261 separate values for each RIC that is why the limit is exceeded. Why the error message doesn't indicate the exceeded limit? I don't know,...
0 -
0
-
As you know via Formula Builder I could get results using this formula for 7500 RIC-codes. I don' think that via Formula Builder we could get more than via Python.
0 -
0
-
Hi @lukasz.trzcinski0 - Are you referring to two different limits - one being the Eikon API limits as defined on the https://developers.refinitiv.com/en/api-catalog/eikon/eikon-data-api/documentation and another being the limitation of the MEDIAN call - on the backend system that EDAPI uses perhaps?
@malashenko.i.o , @gabriel.g and @susskaya.anita - Can you please confirm which country you are located in - so the EDAPI team can confirm which servers your EIKON is connecting to. - in case there is a server-side issue.
UPDATE: No need for pip freeze output. It appears the problem is server-side.
Please still confirm your location so we can identify the servers.
Thanks.
0 -
0
-
@umer.nalla Russia0
-
Austria, Vienna
connecting via EMEA servers0 -
Hi @susskaya.anita , @gabriel.g and @malashenko.i.o
Your tickets should be re-assigned to the server team - who will work with the EDAPI team to investigate further.
Hopefully, the support team will keep you updated on the progress.,
0 -
Has this already been resolved? I am getting similar error messages:
"Asynchronous Query library internal error."
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 685 Datastream
- 1.4K DSS
- 616 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 252 ETA
- 557 WebSocket API
- 38 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 653 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 27 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 193 TREP Infrastructure
- 229 TRKD
- 917 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 90 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛