Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

seaborn countplot

## for single column
sns.countplot(y=df.col)

## for multiple columns
fig, ax = plt.subplots(1, 3, figsize=(25, 10))
fig.suptitle('Count Plot', fontsize=16, y=0.92)

columns = ['Income', 'Age', 'Purchased']
for i, col in enumerate(columns):
    graph = sns.countplot(y=df[col], ax=ax[i])
    ax[i].set_title(*[col])
    graph.bar_label(graph.containers[0])
 
PREVIOUS NEXT
Tagged: #seaborn #countplot
ADD COMMENT
Topic
Name
8+9 =