출처: https://astrocosmos.tistory.com/202 [ASTROCOSMOS:티스토리] 시각화 matplotlib, seaborn 범주형] "countplot, bar chart, pie chart 그리기", sns.countplot, plt.pie, pd.Series.plot(kind='bar') :: 하나둘셋넷
728x90

시각화 matplotlib, seaborn 범주형] countplot, bar chart, pie chart

 

seaborn countplot

 

# sns.countplot(x=titanic['Pclass'])
sns.countplot(x='Pclass', data=titanic)
# sns.countplot(y='Pclass', data=titanic)
plt.grid()
plt.show()

 

막대 그래프 시각화, plot(kind='bar')

train.groupby('Pclass').mean()['Survived'].plot(kind='bar')

 

 

pie chart

 

plt.pie(temp.values, labels = temp.index, autopct = '%.2f%%',
        startangle=90, counterclock=False,
        explode = [0.05, 0.05, 0.05], shadow=True)
plt.show()

 

 

728x90

+ Recent posts