Created
June 9, 2020 03:21
-
-
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
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.line_chart(tickerDf.Close) | |
st.line_chart(tickerDf.Volume) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
tickerDf=tickerData.history(period='1d', stat='2010-5-31',end='2020-5-31')
any advise?