Last active
September 2, 2020 05:25
-
-
Save dataprofessor/dbd6976cf9b1bdb18eb1d0e2e055e2bf to your computer and use it in GitHub Desktop.
myapp2.py from "How to Build Your First Data Science Web App in Python" at https://www.youtube.com/watch?v=ZZ4B0QUHuNc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.write(""" | |
## Closing Price | |
""") | |
st.line_chart(tickerDf.Close) | |
st.write(""" | |
## Volume | |
""") | |
st.line_chart(tickerDf.Volume) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment