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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
7 1 0 2

How to convert Excel formula to Python API request?

Hi

I looked through the manuals, this community, and contacted support, which directed me back here. I have struggle generating the same output from the following Excel request in Python:

=@RDP.Data("LP68192766";"TR.FundTER";"SDate=1990-01-01 EDate=2020-12-31 CH=Fd RH=date";G2)

In Excel, I get something like this:

31.12.2012 0.85

31.12.2013 0.85

31.12.2014 0.85

In Python, I use the following code as adding the Excel parameters apparently does not work:

df, err = ek.get_data(['LP68192766'], ['TR.FundTER'],{'SDate':'1990-01-01', 'EDate':'2020-12-31'})

The output I get is as follows:

0 LP68192766 0.85
1 LP68192766 0.85
2 LP68192766 0.85

I would like to also have the dates of the data points delivered as in Excel. Any help would very much be appreciated.

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

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

1 Answer

Upvotes
Accepted
6.7k 8 6 7

@ErikM Pls try the following:

df, err = ek.get_data(['LP68192766'], ['TR.FundTER.date','TR.FundTER'],{'SDate':'1990-01-01', 'EDate':'2020-12-31'})

df

1626164870993.png

I hope this can help.


1626164870993.png (98.1 KiB)
icon clock
10 |1500

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

Click below to post an Idea Post Idea