๐ ๊ณต๋ถํ๋ ์ง์ง์ํ์นด๋ ์ฒ์์ด์ง?
Dash์ Python์ ์ฌ์ฉํ์ฌ ์ฌ์ฉ์ ์ ๋ ฅ ๊ธฐ๋ฐ ๊ทธ๋ํ ๋ณธ๋ฌธ
๐ฉ๐ป ์ธ๊ณต์ง๋ฅ (ML & DL)/Serial Data
Dash์ Python์ ์ฌ์ฉํ์ฌ ์ฌ์ฉ์ ์ ๋ ฅ ๊ธฐ๋ฐ ๊ทธ๋ํ
์ง์ง์ํ์นด 2022. 11. 14. 14:47728x90
๋ฐ์ํ
<๋ณธ ๋ธ๋ก๊ทธ๋ pythonprogramming_net ๋ธ๋ก๊ทธ๋ฅผ ์ฐธ๊ณ ํด์ ๊ณต๋ถํ๋ฉฐ ์์ฑํ์์ต๋๋ค>
https://pythonprogramming.net/dynamic-data-visualization-application-dash-python-tutorial/
Python Programming Tutorials
Dynamic Graph based on User Input - Data Visualization GUIs with Dash and Python p.3 Welcome to part three of the web-based data visualization with Dash tutorial series. Up to this point, we've learned how to make a simple graph and how to dynamically upda
pythonprogramming.net
๐จ pandas์ datareader์์ ๋ฐ์ดํฐ๋ฅผ ๊ฐ์ ธ์ค๊ธฐ
pip install --upgrade pandas pandas-datareader
๐จ ์ฌ์ฉ์ ์ ๋ ฅ ๊ธฐ๋ฐ ๋์ ๊ทธ๋ํ
- ๋ฐ์ดํฐ ๋ก๋
import pandas_datareader.data as web
import datetime
import dash
import dash_core_components as dcc
import dash_html_components as html
# ๋ฐ์ดํฐ๋ฅผ ๊ฐ์ ธ์ค๋ ค๋ ์์ค, ์์ ๋ ์ง/์๊ฐ, ์ข
๋ฃ ๋ ์ง/์๊ฐ์ ์ง์
# ๋ฐํ์ Pandas ๋ฐ์ดํฐ ํ๋ ์
stock = 'TSLA'
start = datetime.datetime(2015, 1, 1, 0, 0)
end = datetime.datetime.now()
df = web.DataReader(stock, 'yahoo', start, end)
df.reset_index(inplace=True)
df.set_index("Date", inplace=True)
#print(df.info())
- app.layout ๋ด๋ถ์์ ๋ค์ data๋ถ๋ถ์ ์์
- x์ y ๊ฐ์ ์ํ๋ ๊ฐ์ผ๋ก ๋ฐ๊พธ๋ ๊ฒ
app = dash.Dash(__name__)
app.layout = html.Div(children=[
html.H1(children='์ ์ ๊ทธ๋ํ!'),
html.Div(children='''
ํ
์ฌ๋ผ ์ฃผ์ ๊ทธ๋ํ๋ฅผ ๋ง๋ค์ด๋ณด์!!.
'''),
dcc.Graph(
id='example-graph',
figure={
'data': [
{'x': df.index, 'y': df.Close, 'type': 'line', 'name': stock},
],
'layout': {
'title': stock
}
}
)
])
if __name__ == '__main__':
app.run_server(host='0.0.0.0', port=8090 ,debug=True)
728x90
๋ฐ์ํ
'๐ฉโ๐ป ์ธ๊ณต์ง๋ฅ (ML & DL) > Serial Data' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
csv ๋ฐ์ดํฐ๋ก ๋ฏธ๋ ์์ธก LSTM ๋ชจ๋ธ ๋ง๋ค๊ธฐ (0) | 2022.12.08 |
---|---|
Dash์ Python์ ์ฌ์ฉํ์ฌ ์ค์๊ฐ ์ ๋ฐ์ดํธ ๊ทธ๋ํ๋ฅผ ์์ฑ (0) | 2022.11.14 |
CNN-LSTM ์ผ๋ก ์๊ณ์ด ๋ถ์ํ๊ธฐ (0) | 2022.11.04 |
Serial Data ์ฅ์ ์์ธก/๊ฐ์ง LSTM & Conv ๋ชจ๋ธ (0) | 2022.10.28 |
์ฝ๋ก๋ ํ์ง ์๋ฐฉ์ ์ํด ์๊ณ์ด(Time-Series) ๋ฐ์ดํฐ๋ก LSTM ์์ธก ๋ชจ๋ธ๋ง๋ค๊ธฐ (1) | 2022.10.26 |
Comments