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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
19 4 6 9

Is there a way to find listed pre-profit companies in any one index in Python?

Is there a way to find companies listed pre-profit (0 or negavite EBIT) in any one index in Python?

pythonpython apifundamentals
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

Upvotes
Accepted
2.3k 16 2 2

Hi @danieluphromes,


Yes:


import refinitiv.dataplatform.eikon as ek
ek.set_app_key('DEFAULT_CODE_BOOK_APP_KEY')

df, err = ek.get_data(
    instruments=["0#.MIWD00000PUS"],
    fields = ["TR.IPODate"])
df


listOfDf1s, listOfFloatedPreProfitComp = [], []
for j, i in enumerate(df['Instrument']):
    if j % 100 == 0:
        print(j)
    try:
        df1, err = ek.get_data(
            instruments=[i],
            fields = [
                f"TR.EBITMean(SDate={df[df['Instrument'] == i]['IPO Date'].values[0]},Period=FY1).date",
                f"TR.EBITMean(SDate={df[df['Instrument'] == i]['IPO Date'].values[0]},Period=FY1)",
                "TR.IPODate"])
        listOfDf1s.append(df1)
        if df1.values[0][1] <= 0:
            display(df1)
            listOfFloatedPreProfitCompappend(df1)
    except:
        print(f"failed on {i}")



1658151428353.png


1658151428353.png (24.2 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.