when I use the Peers function in codebook, it provides ~50 peers, which is much more than the 7 that

when I use the Peers function in codebook, it provides ~50 peers, which is much more than the 7 that you have said the peers function is supposed to identify.
How do I limit this to the most relevant 7 peers? I am concerned that adding a number to the function may just select 7 out of the ~50 peers arbitrarily,
rather than the 7 most relevant. Perhaps I could speak to someone with experience in using the Peers function in codebook?

Appreciate this can be done in excel as indicated below, but it would be great to keep it in codebook with the rest of my work on this.

Answers

  • @WillCuevas76 Thanks for your question -I cant see any code or RIC to test this with. Please could you paste the API request you want to query. The peers function returns a Starmine curated list of Peers. There is not a number parameter to curtail the response to a certain number of Peers. For example for RR.L (Rolls-Royce plc) - the Peer Analysis tab on the Overview app shows the following:

    image.png

    However - if I edit the Peer set using the Edit Peers button - I can manually select which Peers I think are most relevant in my eyes and save that Peer set down by clicking Save.

    image.png

    When I then call my peers function for RR.L I will get the Peers I have actually selected as the ones I believe to be correct. I tried this and added another 3 peers from the full list of peers and once I had saved it down it was available to me via API call.

    import refinitiv.data as rdfrom refinitiv.data.discovery import Peersrd.open_session()
    
    _peers = Peers('RR.L')df1 = rd.get_data([*_peers], ["TR.HeadquartersCountry", "TR.ExchangeName","TR.TRBCIndustryGroup", "TR.GICSSector", 'TR.CompanyMarketCap', 'TR.EV'])df1
    
    image.png

    In this way you have total control of Peers for comps and valuations. I hope this can help.