Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
Tags
- 분류 결과표
- elbow method
- Machine Learning
- dendrogram
- append()
- del
- hierarchical_clustering
- nan
- analizer
- count()
- pandas
- function
- 최솟값
- 반복문
- IN
- insert()
- list
- wcss
- data
- 덴드로그램
- Dictionary
- sklearn
- string
- matplotlib
- numpy
- Python
- 최댓값
- DataFrame
- DataAccess
- len()
Archives
- Today
- Total
개발공부
[Streamlit] plotly를 이용한 차트그리기 본문
Streamlit 라이브러리의 plotly_chart() 를 사용하면 된다.
prog_languages_data.csv
0.00MB
import streamlit as st
import pandas as pd
import plotly.express as px
def main():
# plotly 라이브러리를 이용한 차트 그리기.
df4 = pd.read_csv('data2/prog_languages_data.csv', index_col=0)
st.dataframe(df4)
# plotly 의 pie 차트
fig1= px.pie(df4, names='lang', values='Sum',
title= '각 언어별 파이차트')
st.plotly_chart(fig1)
# plotly 의 bar 차트
df4_sorted = df4.sort_values('Sum', ascending = False)
fig2 = px.bar(df4_sorted, x='lang', y='Sum')
st.plotly_chart(fig2)
if __name__=='__main__':
main()


'Python > Streamlit' 카테고리의 다른 글
| [Streamlit] Streamlit 이 제공하는 내장 함수로 차트 그리기 (0) | 2022.05.23 |
|---|---|
| [Streamlit] 좌표 정보를 지도에 표시해주는 map() 함수 (0) | 2022.05.23 |
| [Streamlit] matplotlib, seaborn을 이용한 차트 그리기 (0) | 2022.05.23 |
| [Streamlit] 파일 분리하여 작업하기 (0) | 2022.05.23 |
| [Streamlit] 파일을 업로드 하는 방법, 사이드 바 만들기 (0) | 2022.05.23 |