GithubHelp home page GithubHelp logo

srikavya26 / analyzing-historical-stock-revenue-data-and-building-a-dashboard Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1.28 MB

Analyzing Historical Stock/Revenue Data and Building a Dashboard.

Jupyter Notebook 100.00%
coursera data-science jupyter-notebook python3

analyzing-historical-stock-revenue-data-and-building-a-dashboard's Introduction

Analyzing Historical Stock/Revenue Data and Building a Dashboard

Description:

Extracting essential data from a dataset and displaying it is a necessary part of data science.

Using the yfinance Library to Extract Stock Data:

The yfinance is a Python library that provides a user-friendly interface for downloading historical market data from Yahoo Finance. It allows you to get historical stock prices, dividends, and other financial data for stocks, Exchange-Traded Funds (ETFs), and other securities.

Using the Ticker module we can create an object that will allow us to access functions to extract data. To do this we need to provide the ticker symbol for the stock, here the company is Apple and the ticker symbol is AAPL.

import yfinance as yf
msft = yf.Ticker("MSFT")
msft_data = msft.history(period="max")
msft_data.head()

Stock Info:

Using the attribute info we can extract information about the stock as a Python dictionary.

Extracting Share Price:

A share is the single smallest part of a company's stock that you can buy, the prices of these shares fluctuate over time. Using the history() method we can get the share price of the stock over a certain period of time. Using the period parameter we can set how far back from the present to get data. The options for period are 1 day (1d), 5d, 1 month (1mo) , 3mo, 6mo, 1 year (1y), 2y, 5y, 10y, ytd, and max.

Extracting Dividends:

Dividends are the distribution of a companys profits to shareholders. In this case they are defined as an amount of money returned per share an investor owns. Using the variable dividends we can get a dataframe of the data. The period of the data is given by the period defined in the 'history` function.

Libraries :

  • pandas
  • requests
  • BeautifulSoup
  • from plotly.subplots import make_subplots

analyzing-historical-stock-revenue-data-and-building-a-dashboard's People

Contributors

srikavya26 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.