Categorical Plot Types

Trực quan hóa dữ liệu nâng cao với Seaborn

Chris Moffitt

Instructor

Categorical Data

  • Data which takes on a limited and fixed number of values
  • Normally combined with numeric data
  • Examples include:
    • Geography (country, state, region)
    • Gender
    • Ethnicity
    • Blood type
    • Eye color
Trực quan hóa dữ liệu nâng cao với Seaborn

Plot types - show each observation

Each observation categorical plots

Trực quan hóa dữ liệu nâng cao với Seaborn

Plot types - abstract representations

Abstract categorical plots

Trực quan hóa dữ liệu nâng cao với Seaborn

Plot types - statistical estimates

Statistical categorical plots

Trực quan hóa dữ liệu nâng cao với Seaborn

Plots of each observation - stripplot

sns.stripplot(data=df, y="DRG Definition",
              x="Average Covered Charges",
              jitter=True)

stripplot example

Trực quan hóa dữ liệu nâng cao với Seaborn

Plots of each observation - swarmplot

sns.swarmplot(data=df, y="DRG Definition",
              x="Average Covered Charges")

swarmplot example

Trực quan hóa dữ liệu nâng cao với Seaborn

Abstract representations - boxplot

sns.boxplot(data=df, y="DRG Definition",
            x="Average Covered Charges")

boxplot example

Trực quan hóa dữ liệu nâng cao với Seaborn

Abstract representation - violinplot

sns.violinplot(data=df, y="DRG Definition",
               x="Average Covered Charges")

violinplot example

Trực quan hóa dữ liệu nâng cao với Seaborn

Abstract representation - boxenplot

sns.boxenplot(data=df, y="DRG Definition",
              x="Average Covered Charges")

boxenplot example

Trực quan hóa dữ liệu nâng cao với Seaborn

Statistical estimates - barplot

sns.barplot(data=df, y="DRG Definition", 
            x="Average Covered Charges",
            hue="Region")

barplot example

Trực quan hóa dữ liệu nâng cao với Seaborn

Statistical estimates - pointplot

sns.pointplot(data=df, y="DRG Definition", 
              x="Average Covered Charges",
              hue="Region")

pointplot example

Trực quan hóa dữ liệu nâng cao với Seaborn

Statistical estimates - countplot

sns.countplot(data=df, y="DRG_Code", hue="Region")

countplot example

Trực quan hóa dữ liệu nâng cao với Seaborn

Let's practice!

Trực quan hóa dữ liệu nâng cao với Seaborn

Preparing Video For Download...