Phyton code help

What is the python code for the excel formula below:

=@TR("AXXN.O^J92","TR.EPSEstValue","SDate=19901231 EDate=19870101 Frq=D Period=1fq1989 CH=Fd;IN;brokername;fperiod RH=calcdate")

Best Answer

  • raksina.samasiri
    Answer ✓

    Hi @irene.bandal-upo@refinitiv.com ,

    The Data Item Browser and Eikon Data API in Python can help you in generating the Python code for the Eikon Data API with the steps below, In the Data Item Brower (DIB)

    1. Put instrument into the field (RIC)
    2. Search for the data item (field name)
    3. On Parameters tab, adjust the value of parameters you're interested
    4. Click this to copy the code for field name with parameters applied
      1693456567253.png

    And from the DIB and some code adjustment, is this what you're looking for?

    import eikon as ek

    ek.set_app_key('YOUR EIKON APP KEY')

    df, err = ek.get_data(['AXXN.O^J92'], ['TR.EPSEstValue.calcdate', 'TR.EPSEstValue'],
    {'SDate':'19901231', 'EDate':'19870101', 'Period':'1fq1989', 'Frq':'D'})
    df

    1693456418879.png