top of page

Python - Stock Analysis -Visualize

  • Writer: Eighplus Admin
    Eighplus Admin
  • Apr 23, 2022
  • 2 min read

Updated: Apr 27, 2025



FUNTERN Associate: Junyu Fang



· Description

Stock Analysis 02 is based on former Stock Analysis which aims at the visualization of the whole dataset. In this part, I’m going to show 2 regular bar charts and 1 stacked bar chart in total.


· Tasks

1. Create a bar chart to analyze how many stocks do each exchange have.

a. Code:



b. Result:



2. Display a column chart to show the average beta by each industry/sector.

a. Code:



b. Result:



3. Create stacked bar chart to show how many stocks don't have a CEO vs how many have a CEO. Breakdown the results by small-cap, medium-cap and large-cap.

a. Code:



b. Result:




· Summary

From the first bar chart, it’s clearly to see that New York Stock Exchange ranked the first place to own the greatest number of stocks (more than 2000), followed by NYSE Arca and Nasdaq Global Select around 1300. In terms of the second bar chart, obviously, ‘Health Care’ sector gets the highest Beta value among all sectors, which is the only sector with 2+ Beta value. Meanwhile, ‘Energy’ is the sector with second highest Beta which approaches to 2.0. When it comes to the stacked bar chart, the ratio of number of stocks between the companies who has CEO and the ones who has no CEO in ‘Small Marketing Capitalization’ group closes to 1. However, when the values of Marketing Capitalization get bigger (larger Mkt group), the ratio of number of stocks between the companies who has CEO and the ones who has no CEO will get larger, with 2 times in ‘Medium MktCap’ group and 4 times in ‘Large MktCap’ group respectively. To put it briefly, we are able to speculate that a company which has a CEO is more likely to gain larger marketing capitalization.


FUNTERN Associate: Junyu Fang

Comments


bottom of page