I'm using the Refinitiv Python API (refinitiv-data
) to pull ESG data (2013–2024) for multiple companies. I want a wide format like this:
I use the rd.get_history command (see screenshot below), and get a very large dataset with date in column 1, and instrument + variable for each column filled with many N/A values as the values are only available yearly. I have attached a photo of both, my formula and the output.
How can I:
- Get just year-end values for ESG metrics?
- Reshape to the wide format above
Thanks a lot!