how to retrieve last 10 years Return On Invst Cap for a stock/equity via Python?

the circled values, would be great to indicate code to retrive these yearly values in a dataframe Thanks

image


chavalit, your code works. I would be grateful to have the reply of 3 questions:

1. would need the same things for the below 5 numbers for last 10 years(yearly):

sales, EPS(earnings per share), equity(BVPS), (free) cash and total long-term debt

2. would be great to have several stocks for these values in the same df

3. Instead of replying Q1 and Q2, if there is online guide/tutorial which help me achieve above directly, it would be good too.




Best Answer

  • chavalit-jintamalit
    Answer ✓

    Hi @keyan.z

    You can try this code:

    df,e = ek.get_data('IBM.N',
                       ['TR.F.ReturnInvstCapPct.Date','TR.F.ReturnInvstCapPct'],
                       {'SDate':'0','EDate':'-9','Frq':'Y'})
    df


    image

Answers

  • keyan.z
    keyan.z Newcomer

    Thanks your code works. I would be grateful to have the reply of 3 questions:

    1. would need the same things for the below 5 yearly numbers for last 10 years

    sales, EPS(earnings per share), equity(BVPS), (free) cash and total long-term debt

    2. would be great to have several stocks for these values in the same df

    3. Instead of replying Q1 and Q2, if there is online guide/tutorial which help me achieve above directly, it would be good too.

  • Hi @keyan.z

    You can click on the ? icon to get to know the field name.

    image


    Once you know the field name, you can read this tutorial to use Formula Builder or Data Item Browser to see the field parameter.


    If you cannot find the field you are interested in, you can contact Refinitiv Content Helpdesk.

    From API perspective, if the data can be retrieved into Excel using =TR worksheet function, it can also be retrieved using Eikon Data APIs.

    The Refinitiv Content Helpdesk can be reached using Contact Us capability in your Eikon application.
    Or by calling the Helpdesk number in your country.
    Or at https://my.refinitiv.com/

  • keyan.z
    keyan.z Newcomer

    Thanks, I started to search (total) sales but I only found "sales per employee", I am lost as I am not even sure it is in that initial table

  • keyan.z
    keyan.z Newcomer

    Hi AHS, as below your colleague did reply my principal question but I wish to have reply to the 2nd question, which I commented on the 7th April