IT_developers

Python 데이터 분석(주피터노트북) - Pandas(histogram) 본문

Python

Python 데이터 분석(주피터노트북) - Pandas(histogram)

developers developing 2022. 11. 23. 19:00

기본 라이브러리

  • import pandas as pd
  • import matplotlib.pyplot as plt
  • import numpy as np
  • 한글처리
    • plt.rcParams['font.family'] = 'Malgun Gothic'
    • plt.rcParams['axes.unicode_minus'] = False 

 

1~100까지 랜덤 50개 숫자 데이터 생성

 

1) 기본 히스토그램

  • hist()
  • kind='hist'
  • 기본 구간 10 
  • bins : 구간 변경

 

1000개 데이터 생성

 

2) 히스토그램 옵션 주기

  • alpha : 투명도
  • bins : 구간
  • stacked : 쌓기
  • orientation='horizontal' :옆으로 그리기

 

데이터 생성

 

3) 그룹별 히스토그램

  • 카테고리가 구현 되어 있을 때 알아서 그려짐.
  • plot 주지 않기

Comments