Upgrade from Eikon -> Workspace. Learn about programming differences.

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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
31 7 8 19

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

· Write an Answer
Upvotes
Accepted
5.9k 21 2 6

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.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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