Forbes Global 2000 Web Scraping and Data Visualization
Introduction
Forbes Top 2000 list ranks the largest companies in the world and provides financial metrics including market capitalization, assets, profits, and sales. I used Selenium and chromedriver to web scrape the list, along with each company's page. This required me to make the program scroll to the bottom of the page so that the content could be loaded, and then scroll back to the top to start scrubbing the data. I also ran a separate web scraper that would scrape the data I needed, and click to the next page for all 2000 companies. I imported the data into comma delimited files which provided me with two dataframes to work with, so I merged them to begin my analysis.
Overview
After some cleaning of the data, I ended up with each companyβs rank, country, year founded, chairman, industry, assets, sales, profits, market capitalization, and number of employees. The data included companies from 60 countries, and collectively accounted for $39.1 trillion in sales, $3.2 trillion in profit, $189 trillion in assets, and $56.8 trillion in market value.
I wanted to illustrate the distribution of these companies across the countries around the world, find the most prevalent industries, and see how the industries around the world differ from that in the United States. I also wanted to go a bit deeper and try to discover some underlying pattern in the data, including any relationship between sales, profit, assets, and market value. I also wanted to see if there was a difference in these patterns among the mega-large companies and the rest of the list.
Top 20 Countries on the list
This shows an overwhelming majority of companies being from the US, followed by Japan and China. Nearly half of the list comes from the rest of the world.
Industries: Global vs US
Β Β Β Β Β Β
Regional banking is the leading industry across the globe. However, inspection of US industries yields some interesting results. We see that Oil and Gas Operations, Investment Services, Electric Utilities, and Real Estate are all more prevalent than Regional Banking in the US.
Relationships Between Assets, Sales, Market Capitalization, and Profit
Β
I created scatter plots with a line of best fit to illustrate the relationship between the different variables in the data that I scraped. There was a positive correlation between assets and sales, assets and market capitalization, assets and profit, market capitalization and profit, market capitalization and sales.
Interestingly, there does not seem to be a relationship between assets and sales, assets and market capitalization, assets and profit for those companies falling lower on the Forbes List.
Correlation Heatmap
Β Β Β Β Β Β Β Β Β Β Β Β Β Β
I created a heatmap of the correlation matrix to further illustrate this trend in the data. We can see the strongest correlation is between market cap and profits, and this is especially true for the highest ranking companies on the list.
Interestingly, there is a negative correlation between market cap and assets for those companies falling in the middle of the list.