본문 바로가기

Library/Streamlit

Streamlit - Streamlit에서 제공하는 Chart

반응형
Streamlit에서 제공하는 Chart

 

 

 

 

import streamlit as st
import pandas as pd
import altair as alt
import plotly.express as px


 df1 = pd.read_csv('data2/lang_data.csv')
    st.dataframe(df1)

 

 

 

 

line_chart

 

 

st.line_chart(df_choice)

 

 

 

area_chart

 

st.area_chart(df_choice)

 

 

 

 

map_chart

 

df3 = pd.read_csv('data2/location.csv', index_col=0)
st.dataframe(df3)
    
st.map(df3)

 

 

 

 

plotly pie chart

 

fig1 = px.pie(df4, names='lang', values='Sum', title= '각 언어별 파이차트')
st.plotly_chart(fig1)

 

 

plotly bar chart

 

df4_sorted = df4.sort_values('Sum', ascending=False)

fig2 = px.bar(df4_sorted, x= 'lang', y='Sum')
st.plotly_chart(fig2)

 

반응형