커뮤니티
포인트
로딩중
쿠폰
내 강의실
국비 신청 내역
수강권
증명서
숙제 피드백
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
seaborn barplot 실행이 안됩니다
직장인을 위한 실전 데이터 분석 v0
2주차
북마크
설*주
댓글
3
추천
0
조회수
9
조회수
9
답변 완료

* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.

* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.



실행이 왜 안되는지 모르게씁니다 ㅠㅠ


스파르타 즉문즉답



작성한 코드 및 에러 메세지

import pandas as pd

import matplotlib.pyplot as plt

import numpy as np

import seaborn as sns


titanic = pd.read_table('train.csv',sep=',')

titanic.head()

print(titanic.isnull().sum()) 

titanic=titanic.dropna()

titanic.describe()



titanic['Age'].hist(bins=40,figsize=(18,8),grid=True)


titanic['Age_cat'] = pd.cut(titanic['Age'],bins=[0,3,7,15,30,60,100],include_lowest=True,labels=['baby','children','teenage','young','adult','old'])

titanic.groupby('Age_cat').mean()


#그래프 크기 설정

plt.figure(figsize=(14,5))

# 바 그래프 그리기 (x축 = Age_cat, y축 = Survived)

sns.barplot('Age_cat','Survived',data=titanic)

# 그래프 나타내기

plt.show()





취소
 공유
취소
댓글 0
댓글 알림
나의얼굴