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.

Best Answer

  • @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.