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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 0 1 3

First time user here - Translating from Excel to Python

Hi,

I am trying to translate the following function:
=@TR( 'BNPP.PA' ,"TR.ROATotalAssetsPercent","SDate=#1 CH=Fd",,2021-04-21)


My implementation doesnt work:

fields = ['TR.ROATotalAssetsPercent', 'TR.ROAActValue']

parameters = { 'SDate' : '#1', 'EDate' : '2021-04-21', 'CH' : 'Fd' }

ticker = 'BNPP.PA'

data_grid, err = ek.get_data(ticker, fields = fields, parameters = parameters)

Could anyone provide insights? Thank you.

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonexcel
icon clock
10 |1500

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

1 Answer

Upvote
Accepted
15.2k 40 12 19

Try something like this -

df, err = ek.get_data( 'BNPP.PA', ['TR.ROATotalAssetsPercent', 'TR.ROAActValue'], {'SDate': '2021-04-21', 'EDate':'2021-04-30', 'FRQ': 'D'})


1621521787221.png (17.5 KiB)
icon clock
10 |1500

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