Python streamlit 에서 DataFrame 웹 화면에 표시
▷ 실행
# 판다스 데이터 프레임을 웹 화면에 보여주는 방법
import streamlit as st
import pandas as pd
def main() :
df = pd.read_csv('./data/iris.csv')
st.dataframe(df)
# species 컬럼의 유니크 값을 화면에 표시
st.write(df['species'].unique())
st.text('아이리스 꽃은' + df['species'].unique() + '로 되어 있다.')
if __name__ == '__main__' :
main()
▶ 결과
'Dashboard App > streamlit' 카테고리의 다른 글
[streamlit] 자주사용하는 위젯, 다양한 UI 함수들(button, radio, checkbox, selectbox, multiselect, slider, expander) (0) | 2024.04.24 |
---|---|
[streamlit] 제목, 텍스트, 메시지 설정하는 방법 (0) | 2024.04.23 |
[streamlit] 설치, 시작하기 (0) | 2024.04.23 |