Seaborn

Python dla użytkowników R

Daniel Chen

Instructor

Seaborn

  • wykresy słupkowe: barplot
  • histogramy: histplot
  • wykresy pudełkowe: boxplot
  • wykres punktowy: regplot
  • Zalety Seaborn
    • kolorowanie punktów według danych
    • wykresy fasetowe według danych
Python dla użytkowników R

Histogramy w Seaborn

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

Python dla użytkowników R

Wykres liczności w Seaborn

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

Python dla użytkowników R

Wykresy pudełkowe w Seaborn

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

Python dla użytkowników R

Wykresy punktowe w Seaborn

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

Python dla użytkowników R

Wykresy punktowe Seaborn bez linii regresji

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

Python dla użytkowników R

Fasetki w Seaborn

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

Python dla użytkowników R

Seaborn FacetGrid

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

Python dla użytkowników R

Czas na ćwiczenia!

Python dla użytkowników R

Preparing Video For Download...