вторник, 9 мая 2023 г.

Seaborn - pairplot, scatterplot, relplot

Plot pairwise relationships in a dataset. Документация - https://seaborn.pydata.org/generated/seaborn.pairplot.html
penguins = sns.load_dataset("penguins")
sns.pairplot(penguins)

#sns.pairplot(penguins, hue="species")
#sns.pairplot(penguins, hue="species", diag_kind="hist")
#sns.pairplot(penguins, kind="kde")

g = sns.pairplot(penguins, diag_kind="kde")
g.map_lower(sns.kdeplot, levels=4, color=".2")

Draw a scatter plot with possibility of several semantic groupings. 
Документация - https://seaborn.pydata.org/generated/seaborn.scatterplot.html

sns.scatterplot(data=tips, x="total_bill", y="tip", hue="size")
Figure-level interface for drawing relational plots onto a FacetGrid. This function provides access to several different axes-level functions that show the relationship between two variables with semantic mappings of subsets.  
Документация - https://seaborn.pydata.org/generated/seaborn.relplot.html

sns.relplot(data=tips, x="total_bill", y="tip", hue="day", col="time")

Комментариев нет:

Отправить комментарий