파이썬 시각화 차트 종류
1. Column/Bar chart
2. Dual Axis, 파레토 chart
3. Pie chart
4. Line chart
5. Scatter chart
6. Bubble chart
7. Heat map
8. Histogram
9. Box plot
10. Geo chart
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
marathon_2015_2017 = pd.read_csv('./data_boston/marathon_2015_2017.csv')
# 튜플 형태로 라벨 지정
labels = 'Male', 'Female'
labels
# 차트를 입체적으로 보이게
explode = (0, 0.1)
marathon_2015_2017.columns
marathon_2015_2017['M/F'].value_counts()
plt.figure(figsize=(7,7))
# pie chart 만들기(차트 띄우기, labels 달기, 각 조정, 그림자, 값 소숫점 표시)
plt.pie(marathon_2015_2017['M/F'].value_counts(), explode=(0, 0.05), labels=labels, startangle=90, shadow=True, autopct='%.1f')
# 라벨, 타이틀 달기
plt.title('Male vs Female', fontsize=18)
# 레전드 달기
plt.legend(['Male', 'Female'], loc='upper right')
plt.show()
'Crawling > 데이터 시각화' 카테고리의 다른 글
데이터시각화_10가지_Scatter chart (0) | 2022.01.06 |
---|---|
데이터시각화_10가지_Line chart (0) | 2022.01.06 |
데이터시각화_10가지_Dual Axis, 파레토 chart (0) | 2022.01.06 |
데이터시각화_10가지_Column/Bar chart (0) | 2022.01.06 |
pandas다루기_마라톤_시각화 (0) | 2022.01.06 |