The data collected by the below code are not matched with browser's(data malposition)
SDate = '2021-6-10'
EDate = '2022-6-10'
df,das = ek.get_data('AAPL.O',
['TR.OfficerTitle()',
'TR.ODOfficerFullName(ODRnk=R1:R100)',
'TR.ODDirectorStartDate(ODRnk=R1:R100)',
'TR.ODOfficerPersonGender(ODRnk=R1:R100)',
'TR.ODOfficerPersonAge(ODRnk=R1:R100)',
'TR.ODOfficerCompSalary(ODRnk=R1:R100,SDate={},Edate={})'.format(SDate,EDate),
'TR.ODOfficerCompBonus(ODRnk=R1:R100,SDate={},Edate={})'.format(SDate,EDate),
'TR.ODOfficerCompTAC(ODRnk=R1:R100,SDate={},Edate={})'.format(SDate,EDate),
'TR.ODOfficerCompRSA(ODRnk=R1:R100,SDate={},Edate={})'.format(SDate,EDate),
'TR.ODOfficerCompAOC(ODRnk=R1:R100,SDate={},Edate={})'.format(SDate,EDate),]
df
python response
first person in browser
Best Answer
-
Hi @y.jia10 ,
Thank you for your patience. As checked, the data seems to come from different databases because I tried to get the same data with Eikon Excel and found that if the parameter RH=OfficerID is defined, the data will be arranged properly. Unfortunately, the RH parameter cannot be used with Eikon Data APIs (mentioned in the answer of this thread).
Hence I'd recommend to separate the call of each group of fields then then merge them together by OfficerID parameter, the output dataframe compared to the output in Eikon Excel are match.
please see an example code below
import pandas as pd
SDate = '2021-6-10'
EDate = '2022-6-10'
# define parameters to be used on every call
parameters = {'SDate': SDate, 'EDate': EDate, 'ODRnk': 'R1:R100'}
# retrieve 1st group of fields
name_df,name_err = ek.get_data('AAPL.O',['TR.ODOfficerFullName.OfficerID'
,'TR.ODOfficerFullName'
,'TR.ODDirectorStartDate'
,'TR.ODOfficerPersonGender'
,'TR.ODOfficerPersonAge'
],
parameters = parameters
)
# retrieve 2nd group of fields
comp_df,comp_err = ek.get_data('AAPL.O',['TR.ODOfficerCompSalary.OfficerID'
,'TR.ODOfficerCompSalary'
,'TR.ODOfficerCompBonus'
],
parameters = parameters
)
# retrieve 3rd group of fields
comp2_df,comp2_err = ek.get_data('AAPL.O',['TR.ODOfficerCompTAC.OfficerID'
,'TR.ODOfficerCompTAC'
,'TR.ODOfficerCompRSA'
,'TR.ODOfficerCompAOC'
],
parameters = parameters
)
# merge them together
df = pd.merge(name_df, comp_df, how='outer', on=['Instrument','Officer PermID'])
df = pd.merge(df, comp2_df, how='outer', on=['Instrument','Officer PermID'])
dfBelow are the dataframes before they're merged together
Hope this helps and please let me know in case you have any further questions.
1
Answers
-
hi @y.jia10 ,
Could you please attach the result from this code and the browser data that are mismatched for further investigation?
Thanks,
AHS0 -
@raksina.samasiri thanks for your reply, i am confused about how to upload the image along with the comments. it no responds after clicking "Post"
0 -
According to the browser's data, the salary and bonus columns of the first person should be a null value. After checking, those values would belong to the second person(data malposition). Thanks in advance for your help.
0 -
Note: Eikon Excel formula
=@TR("AAPL.O","TR.OfficerTitle;TR.ODOfficerFullName;TR.ODDirectorStartDate;TR.ODOfficerPersonGender;TR.ODOfficerPersonAge;TR.ODOfficerCompSalary;TR.ODOfficerCompBonus;TR.ODOfficerCompTAC;TR.ODOfficerCompRSA;TR.ODOfficerCompAOC","CH=Fd RH=OfficerID NULL=BLANK ODRnk=R1:R100 SDate=2021-06-10 EDate=2022-06-10")
0 -
@raksina.samasiri thanks for your reply. this is good idea.0
Categories
- All Categories
- 6 AHS
- 39 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 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 中文论坛