How can I obtain the information of TR.HeadquartersCountry companies in a specific country in Python

Hi,

I want to pull the data for the companies of specific exchange of a country. But I couldn't put the python code of the "Country of Headquarters" (Data Item Name), "TR.HeadquartersCountry" (Data Item Code) into my work.


ex:

esg=[

'TR.CompanyName',

'TR.TRESGResourceUseScore(Period=FY0)',

'TR.TRESGEmissionsScore(Period=FY0)']

result, err= ek.get_data('0#.FTSE', fields=esg)


How can I change the .FTSE with "TR.HeadquartersCountry". I don't want to see the companies in FTSE but I prefer to see "the companies that Country of Headquarters is UK".

Thanks



Best Answer

  • AgnesTerada
    Answer ✓

    ramazan.aslan

    You could screen for companies in the FTSE 100 that are headquartered in the UK:

    screen = 'SCREEN(U(IN(indices(4932935/*FTSE 100*/))),IN(TR.HQCountryCode,"GB"))'

    fields = ["TR.CommonName","TR.TRESGResourceUseScore(Period=FY0)","TR.TRESGEmissionsScore(Period=FY0)"]

    df, e = ek.get_data(screen,fields)

    1631624488091.png


Answers