countplot in seaborn code example

Example 1: countplot for different classes in a column

>>> ax = sns.countplot(x="who", data=titanic, palette="Set3")

Example 2: countplot

A countplot is kind of likea histogram or a bar graph for some categorical area. ... You put this statement in if you are using an editor such as jupyter notebooks so that you can see the graph output in the editor. Seaborn already has built-in data sets. One data set that can be used is tips.

Example 3: seaborn countplot

import pandas as pd
import seaborn as sns
df = pd.DataFrame()

sns.countplot(data=df)

Example 4: sns.countplot

from sklearn.preprocessing import StandardScaler