Seaborn

Python pro uživatele R

Daniel Chen

Instructor

Seaborn

  • sloupcové grafy: barplot
  • histogramy: histplot
  • krabicové grafy: boxplot
  • bodové grafy: regplot
  • Výhody Seabornu
    • barevné body podle dat
    • facetové grafy podle dat
Python pro uživatele R

Seaborn histogramy

import seaborn as sns
import matplotlib.pyplot as plt
sns.histplot(iris['sepal_length'], kde = True)
plt.show()

Python pro uživatele R

Seaborn graf počtů

sns.countplot('species', data=iris)
plt.show()

Python pro uživatele R

Seaborn krabicové grafy

sns.boxplot(x='species', y='sepal_length', data=iris)
plt.show()

Python pro uživatele R

Seaborn bodové grafy

sns.regplot(x='sepal_length', y='sepal_width', data=iris)
plt.show() 

Python pro uživatele R

Seaborn bodové grafy bez regresní přímky

sns.regplot(x='sepal_length', y='sepal_width', data=iris,
            fit_reg=False)
plt.show()

Python pro uživatele R

Seaborn facety

sns.lmplot(x='sepal_length', y='sepal_width', data=iris,
           fit_reg=False,
           col='species')
plt.show() 

Python pro uživatele R

Seaborn FacetGrid

g = sns.FacetGrid(iris, col="species")
g = g.map(plt.hist, "sepal_length")
plt.show()

Python pro uživatele R

Pojďme procvičovat!

Python pro uživatele R

Preparing Video For Download...