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
38 5 13 18

Align ESG data with market data (in time).

I'm working with the EK API to get ESG data with market and fundamentals data for a company (e.g., AAPL.O). My goal is to pull fields related to price, market cap, ESG scores, and Scope 1 emissions (and other extra-financial data). I have problem aligning the dates. Here is the code I'm using:

fields = [ 'TR.PriceClose', 'TR.PriceClose.date',
           'TR.CompanyMarketCap', 'TR.CompanyMarketCap.date',
           'TR.TRESGCScoreGrade', 'TR.TRESGCScoreGrade.date', 
           'TR.Scope1EstTotalToEVIC','TR.Scope1EstTotalToEVIC.date' ]

pd1 = { 'SDate': '0', 'Frq': 'FY', 'EDate': '-20', 'Period': 'FY0', 'AddSource': 'True', 'IncludePartialYear': 'True' }

df, err = ek.get_data( instruments = ['AAPL.O'], fields = fields, parameters = pd1 ) 

The data retrieval works, but I am unsure how to best align the ESG data with market and fundamentals data over the same period. How can I ensure that these different data types (price, market cap, ESG scores, emissions) are correctly aligned over time?

The output provides different dates for each variable. I am getting price and Market Cap for December for the ESG scores that were reported in September. In this case, GHG and ESG data where reported the same date, I don't know if this holds for other extra-financial data, which will make it worst.
screenshot-2024-08-22-at-181419.png

This gap is exacerbated when 'IncludePartialYear': 'False' or

pd1={'SDate':'2001-01-01','Frq':'FY', 'EDate':'2024-01-01', 'Period':'FY0'} 

Any suggestions on how to approach this or pointers to relevant documentation would be greatly appreciated.

Thanks in advance!

eikon-data-apiworkspace#technologypython apiesg
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
85k 289 53 77

@ricardo.henriquez

Thank you for reaching out to us.

Those fields are from different categories so the dates may not be aligned. Moreover, each category can support different parameters.

For example, the TR.CompanyMarketCap field is in the Time Series Ratios category why the TR.TRESGCScoreGrade field is in the Environmental, Social and Governance category.

You can use the Formula Builder in Excel to check the fields' categories.

You can group fields that are in the same category together and then merge results according to your requirements.


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.