티스토리 뷰
반응형
Medium 에서 글을 보다가 전부터 보던 streamlit 관련된 글이 있어서
다시 사용해본 후 쓰는 글입니다.
예전에 한번 쓰려 했으나, 당시에는 버그 등이 너무 많아서 아쉬웠지만
이제는 안정화가 되었길 빌며 설치를 진행했습니다.
설치
pip install streamlit
기본 실행
streamlit hello
Mapping, Animation, Plotting, Dataframe 등 다양한 데모를 확인 가능합니다.
원하는 파일 실행 시
streamlit run <file_name>
Example
pip install opencv-python
streamlit run https://raw.githubusercontent.com/streamlit/demo-self-driving/master/app.py
# stream.py
import streamlit as st
import numpy as np
import pandas as pd
st.title('My first app')
df = pd.DataFrame({
'first column': [1, 2, 3, 4],
'second column': [10, 20, 30, 40]
})
# Line Chart
chart_data = pd.DataFrame(
np.random.randn(20, 3),
columns=['a', 'b', 'c'])
st.line_chart(chart_data)
# Plot a map
map_data = pd.DataFrame(
np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],
columns=['lat', 'lon'])
st.map(map_data)
if st.checkbox('Show dataframe'):
chart_data = pd.DataFrame(
np.random.randn(20, 3),
columns=['a', 'b', 'c'])
st.line_chart(chart_data)
# Selectbox
# option = st.selectbox(
# 'Which number do you like best?',
# df['first column'])
#
# 'You selected: ', option
# Widget
option = st.sidebar.selectbox(
'Which number do you like best?',
df['first column'])
'You selected:', option
-- 추후 수정 예정--
반응형
'Development > Python' 카테고리의 다른 글
[python] python3.8 새롭게 추가된 기능 몇 가지 (0) | 2020.09.24 |
---|---|
[python] dictionary 기본 (0) | 2020.08.31 |
[python] csv 파일 저장하기 (0) | 2020.08.23 |
파이썬 기초 (6분 컷) (0) | 2020.08.20 |
3 Web Scraping Methods in python (0) | 2020.08.06 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- Algorithm
- csv
- palindrome
- 책리뷰
- K8S
- error
- lllm
- book
- LLM
- 키보드
- Kubernetes
- Python
- Container
- 한빛미디어
- kubens
- feed-forward
- Gemma
- collator
- go
- AWS
- Shell
- 나는리뷰어다
- leetcode
- Git
- docker
- Binary
- 파이썬
- kubernetes context
- Fine-Tuning
- BASIC
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
글 보관함
반응형