ESG data extraction

Hi,
I am extracting multiple ESG metrics for various companies from 2006 to 2024. However, I’m facing an issue: the output structure does not include a date for every company when data is missing. I would like to modify the output so that there is an entry for every date in the range for all companies, regardless of whether data is available.
I have attached my code along with a screenshot showing a snippet of the current output. Could you please assist with this?
Thank you in advance.
Emission Fieldsemissions_fields = [
"TR.AnalyticEnvExpenditures.fperiod",
"TR.AnalyticEnvExpenditures",
"TR.PolicyEmissions",
"TR.TargetsEmissions",
"TR.BiodiversityImpactReduction",
"TR.NOxSOxEmissionsReduction",
"TR.VOCEmissionsReduction",
"TR.PMReduction",
"TR.WasteReductionInitiatives",
"TR.eWasteReduction",
"TR.EmissionsTrading",
"TR.EnvPartnerships",
"TR.ISO14000",
"TR.EMSCertifiedPct",
"TR.EnvRestorationInitiatives",
"TR.StaffTransportationReduction",
"TR.ClimateChangeRisksOpp",
"TR.EnvInvestments",
"TR.WasteRecyclingRatio",
"TR.EmissionReductionTargetPctage",
"TR.EmissionsTargetAnnualReduction",
"TR.BiodiversityNetPositiveImpact",
"TR.BiodiversityTargets",
"TR.TargetsPollution",
"TR.TargetsWaste",
"TR.PolicyPollution",
"TR.PolicyWaste",
"TR.AnalyticEnvExpendituresScore",
"TR.PolicyEmissionsScore",
"TR.eWasteReductionScore",
"TR.EmissionsTradingScore",
"TR.EnvPartnershipsScore",
"TR.EMSCertifiedPctScore",
"TR.EnvRestorationInitiativesScore",
"TR.StaffTransportationReductionScore",
"TR.ClimateChangeRisksOppScore",
"TR.BiodiversityCommitment"
]
start_date = '2006-12-31'
end_date = '2024-12-31'
ric = list(historical_constituents['Constituent RIC'].unique())
def get_esg_data(fields, ric):
df = ld.get_data(
universe=ric,
fields=fields,
parameters={'Sdate': start_date, 'Edate': end_date, 'Frq': 'FY', 'Period': 'FY0'},
header_type=ld.HeaderType.TITLE
)
return df
emissions_df = get_esg_data(emissions_fields, ric)
emissions_df
Answers
-
Thank you for reaching out to us.
I tested the following code.
emissions_fields = [ "TR.AnalyticEnvExpenditures.fperiod", "TR.AnalyticEnvExpenditures", "TR.PolicyEmissions.fperiod", "TR.PolicyEmissions", "TR.PolicyEmissionsScore.fperiod", "TR.PolicyEmissionsScore" ] start_date = '2006-12-31' end_date = '2024-12-31' df = ld.get_data( universe=["BBBY.OQ^E23","INSW.N"], fields=emissions_fields, parameters={'Sdate': start_date, 'Edate': end_date, 'Frq': 'FY', 'Period': 'FY0'}, header_type=ld.HeaderType.TITLE ) df
I got this data.
First, you can contact the helpdesk team directly via MyAccount to verify the content.
As far as I know, the API doesn't have an ability to fill in missing values.
0 -
Hi,
Thank you for your assistance.
Just to confirm:
It is not possible to extract all dates within the specified date range at the given frequency without retrieving the date ("fperiod") for every single data point? I want to limit the data extraction as much as possible :-)
0 -
API just sends a request to the endpoint and retrieve a response.
You may need to contact the helpdesk team to confirm this.
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 684 Datastream
- 1.4K DSS
- 615 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 249 ETA
- 554 WebSocket API
- 37 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 643 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 26 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 192 TREP Infrastructure
- 228 TRKD
- 915 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 90 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛