Blank Video Poster

Get the S&P 500 Current & Historical Companies Using Python

Dec 11, 2024
Learn how to scrape Wikipedia with Python & Pandas to get the current S&P 500 members. We'll also create a historical constituents list for backtesting and algorithmic trading purposes. If you're not interested in learning how to web scrape, you can download the files below.šŸ‘‡ šŸ‘ Subscribe for more tutorials like this: https://bit.ly/3lLybeP šŸ‘‰ Download S&P 500 Data: https://bit.ly/3ESGVs7 0:37 Wikipedia S&P 500 Companies Page Overview 1:53 Import Pandas and Datetime 2:15 Use Pandas to Scrape Wikipedia's S&P 500 Data 3:52 Modify Current S&P 500 Members Dataframe 6:58 Correct S&P 500 Member Date Values 10:44 Modify S&P 500 Historical Adjustments DataFrame 12:09 Correct Missing S&P500 Historical Values 13:30 Create S&P 500 Additions & Removals Dataframes 15:58 Merge Additions & Removal Dataframes 16:55 Identify Missing Historical Tickers 17:48 Merge Missing Tickers 19:59 Export S&P 500 Current & Historical Data to CSV

View Video Transcript
#Programming #Investing