Skip to content

Instantly share code, notes, and snippets.

@dataprofessor
Created June 9, 2020 03:21
Show Gist options
  • Save dataprofessor/7c63d5ea58a71e3dc8601ff6f6f35165 to your computer and use it in GitHub Desktop.
Save dataprofessor/7c63d5ea58a71e3dc8601ff6f6f35165 to your computer and use it in GitHub Desktop.
myapp.py from "How to Build Your First Data Science Web App in Python" at https://www.youtube.com/watch?v=ZZ4B0QUHuNc
import yfinance as yf
import streamlit as st
st.write("""
# Simple Stock Price App
Shown are the stock closing price and volume of Google!
""")
# https://towardsdatascience.com/how-to-get-stock-data-using-python-c0de1df17e75
#define the ticker symbol
tickerSymbol = 'GOOGL'
#get data on this ticker
tickerData = yf.Ticker(tickerSymbol)
#get the historical prices for this ticker
tickerDf = tickerData.history(period='1d', start='2010-5-31', end='2020-5-31')
# Open High Low Close Volume Dividends Stock Splits
st.line_chart(tickerDf.Close)
st.line_chart(tickerDf.Volume)
@cefioase
Copy link

tickerDf=tickerData.history(period='1d', stat='2010-5-31',end='2020-5-31')

  • GOOGL: No data found for this date range, symbol may be delisted
    any advise?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment