Fetching a company’s peers¶
Show code cell content
import refinitiv.data as rd
rd.open_session()
/home/runner/.local/share/virtualenvs/refinitiv-data-python-cookbook-I-HIyNf4/lib/python3.10/site-packages/refinitiv/data/_access_layer/session.py:71:FutureWarning:
You open a platform session using the default value of the signon_control parameter (signon_control=True).
In future library version v2.0, this default will be changed to False.
If you want to keep the same behavior as today, you will need to set the signon_control parameter to True either in the library configuration file
({'sessions':{'platform':{'your_session_name':{'signon_control':true}}}}) or in your code where you create the Platform Session.
These alternative options are already supported in the current version of the library.
<refinitiv.data.session.Definition object at 0x7f65dcf8d090 {name='rdp'}>
You can use the Refinitiv Data Library for Python to retrieve a list of the companies judged to be peers of a given company.
To do so, pass a company’s Refinitiv Instrument Code to the Peer
component of the package’s discovery
submodule. By default, the method only returns the code of each peer. You’ll need to pass the resulting list to another query to retrieve additional information about each company.
Here’s how to retrieve each of the Thomson Reuters’ peers:
rd.discovery.Peers("TRI.N")
<refinitiv.data.discovery._universe_expanders._peers.Peers at 0x7f65ecb22440>
You’ll need to convert it to a list
object to see the results.
list(rd.discovery.Peers("TRI.N"))
['SPGI.N',
'MSCI.N',
'FDS.N',
'WLSNc.AS',
'REL.L',
'EXPN.L',
'HEIJ.AS',
'MORN.OQ',
'QBRb.TO',
'CCA.TO',
'CJRb.TO',
'T.TO',
'RCIb.TO',
'BCE.TO',
'RHI.N',
'EFX.N',
'VRSK.OQ',
'CGX.TO',
'RAYa.TO',
'MCO.N',
'CTAS.OQ',
'TRU.N',
'BFAM.N',
'WILD.TO',
'FORA.TO',
'IT.N',
'IRM.N',
'ADT.N',
'VSTS.N',
'CLVT.N',
'DNB',
'TCLa.TO',
'BRMI.TO',
'ILLM.TO',
'MAN.N',
'PAYX.OQ',
'ROL.N',
'BV.N',
'UNF.N',
'TOY.TO',
'PAYC.N',
'FICO.N',
'DAY.N',
'STER.OQ',
'ARMK.N',
'ADP.OQ',
'KBR.N',
'SAIC.OQ',
'CACI.N',
'PSN.N']
Show code cell content
rd.close_session()