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
7 1 1 5

Eikon Python API returning different value on same data item for same day

Hi,

I have a ek.get_data() script, and it's returning different values for the same data item for the same trading day if I specify a date range, but it's fine if I only specify one day in the same script:

df_ric_ts, err_ric_ts = ek.get_data(['AIBGY.PK'],
                                    ['TR.PriceClose.date; TR.PriceClose; TR.TotalReturnYTD; TR.TotalReturnMTD; '
                                     'TR.TotalReturnQTD; TR.TotalReturn6Mo, TR.CompanyMarketCap; TR.PE; TR.PriceToBVPerShare; '
                                     'TR.PriceToTangBVPerShare; '
                                     'TR.FwdPEG; TR.BasicNormalizedEps.date; TR.BasicNormalizedEPS; '
                                     'TR.LTDebtToTtlCapitalPct; TR.TtlDebtToTtlEquityPct'],
                                    {'SDate': '2023-03-01', 'EDate': '2023-02-15', 'CURN': 'USD', 'FRQ': 'D'})

The result of above script gives me below value:

1677772679105.png

It's a partial screenshot, but you can see, the return column and market cap column are all having different values for same day, 2/23, 2/21 and 2/13.

If I only specify one day like below for 2/23:

df_ric_ts, err_ric_ts = ek.get_data(['AIBGY.PK'],
                                    ['TR.PriceClose.date; TR.PriceClose; TR.TotalReturnYTD; TR.TotalReturnMTD; '
                                     'TR.TotalReturnQTD; TR.TotalReturn6Mo, TR.CompanyMarketCap; TR.PE; TR.PriceToBVPerShare; '
                                     'TR.PriceToTangBVPerShare; '
                                     'TR.FwdPEG; TR.BasicNormalizedEps.date; TR.BasicNormalizedEPS; '
                                     'TR.LTDebtToTtlCapitalPct; TR.TtlDebtToTtlEquityPct'],
                                    {'SDate': '2023-02-23', 'EDate': '2023-02-23', 'CURN': 'USD', 'FRQ': 'D'})

print(df_ric_ts)

Below is the result:

1677772906257.png

Why is that?

Plus I have asked this to the helpdesk/support team, and they recommend me here to ask this question. Thank you.

eikon#product#contentpython api
1677772679105.png (58.0 KiB)
1677772906257.png (14.1 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.

1 Answer

· Write an Answer
Upvote
Accepted
166 2 1 3

In short, the data of price related column you retrieved depend only on the close price of the RIC ‘AIBGY.PK’. While the result of "Company Market Cap" - a company level market_cap instead of instrument level market_cap comes from the aggregated calculation of all RICs whose underlying is "AIBG.I" .

Meanwhile, the TR.PriceClose.date as shared date of the DataFrame made it even confusing.

You can try with following code to separate date for close price and market_cap and see the difference.

aibg.png


aibg.png (38.4 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.