Hands-on Lab: Analyzing Historical Stock/Revenue Data and Building a Dashboard

Extracting and Visualizing Stock Data

This assignment is a part of my Course (Python Project for Data Science) provided by IBM SKILL NETWORK . In this project, I'll extract essential data from a dataset and display it in a graph. The goal is to provide a clear visualization of stock data and revenue data for two companies, Tesla and GameStop.

Table of Contents

Getting Started

These instructions will help you get started with the assignment and understand how to complete each question step by step.

Prerequisites

  • Python
  • Jupyter Notebook
  • Required Python libraries (e.g., pandas, requests, yfinance, BeautifulSoup, plotly)

Define a Function that Makes a Graph

In this section, we define the function make_graph that is used for creating the stock data graph. You don't need to understand the internal workings of the function; you should focus on the inputs it requires.

Question 1: Use yfinance to Extract Stock Data

Here, we use the yfinance library to extract stock data for Tesla and GameStop and save it as dataframes. The data is used for subsequent visualizations.

Question 2: Use Webscraping to Extract Tesla Revenue Data

We use the requests library and BeautifulSoup to scrape Tesla's revenue data from a web page. This data is used in the graph.

Question 3: Use yfinance to Extract Stock Data

Similar to Question 1, we extract stock data for GameStop using the yfinance library.

Question 4: Use Webscraping to Extract GME Revenue Data

Using web scraping techniques, we extract revenue data for GameStop from a web page, which is required for the visualization.

Question 5: Plot Tesla Stock Graph

This is where we create the graph for Tesla's stock data using the make_graph function. The graph displays historical share prices and revenue.

Question 6: Plot GameStop Stock Graph

Similar to Question 5, we create a graph for GameStop's stock data.

Authors

Aniket Bembale