[date science] seaborn

덴장·2026년 4월 18일

data

목록 보기
20/55
  • 설치
jupyter notebook에서
!conda install --yes seaborn

  • csv파일 읽기
import seaborn as sbn
import pandas as pd
import matplotlib as plt
df = pd.read_csv('data/bike.csv')
df

  • bar 형태
sbn.barplot(data=df, x='month',y='total')

  • 바 위에 검은선을 지우려면 옵션에 errorbar=None 추가
sbn.barplot(data=df, x='month',y='total')
  • 그래프 사이즈 변경
sbn.set_theme(rc={'figure.figsize':(12,6)})#가로,세로

  • 영업일 기준 그래프
sbn.set_theme(rc={'figure.figsize':(8,4)},style='white')
sbn.barplot(data=df, x='month',y='total',errorbar=None, hue='workingday')

  • 영업일 기준 그래프
sbn.set_theme(rc={'figure.figsize':(8,4)},style='white')
sbn.barplot(data=df, x='month',y='registered',errorbar=None, hue='workingday')

  • 영업일기준 선그래프
sbn.set_theme(rc={'figure.figsize':(8,4)},style='white')
sbn.lineplot(data=df, x='month',y='registered',errorbar=None, hue='workingday')

profile
개발자

0개의 댓글