I'm hoping someone may be able to help me with the following issue. I'm new to python so this may seem like a novice request. Apologies in advance.
I wish to extract relative valuation data (P/E, P/B, P/S, EV/EBITDA - all TTM) on all S&P500 constituent stocks for the period 2006-2021 into a table on python. What is the cleanest way to code this? I have tried manually including each RIC & also (unsuccessfully) manipulating the 'peers' function.
I'm aware there will be leavers and joiners included in the dataset but that does not pose an issue to the research I then plan to complete on the dataset.
I've read numerous other threads that pose a similar question but I haven't been able to successfully alter their code to achieve my goal. I can share my code thus far if it helps.