How to Retrieve All Listed Companies by Exchange Country in CodeBook

146205
146205 Newcomer

Hi,

I'm currently working with CodeBook and ran into a problem that I'd like to get some help with.

Previously, I used the “Country of Exchange” filter in Screener to select all companies listed on a specific country’s exchange. I’m wondering how I can replicate the same filtering in CodeBook using code.

Here’s the code I’m using right now:

import pandas as pd
import refinitiv.data as rd

universe =
print(universe)

rd.open_session()
df = rd.get_data(
universe = ['US'],
fields = ['TR.Scope1andScope2andScope3EstTotal(SDate=0,
EDate=-9,
Frq=CELLREF,
Period=FY0)',
'TR.AnalyticScope1andScope2andScope3EstTotalsToRevenues(SDate=0,
EDate=-9,
Frq=CELLREF,
Period=FY0)',
'TR.AnalyticTotalRenewableEnergy(SDate=0,
EDate=-9,
Frq=CELLREF,
Period=FY0)',
'TR.CapexActValue(SDate=0,
EDate=-9,
Frq=CELLREF,
Period=FY0)'
]
)
display(df)

打印結果

print(df1)
df1.to_csv('data world.csv', index=False)

How should I modify this to get the same results as filtering by “Country of Exchange”?

Thanks!

Answers