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

График распределения одной величины - distplot

Документация - https://seaborn.pydata.org/generated/seaborn.distplot.html
import seaborn as sns
sport = sns.load_dataset('exercise')
sns.distplot(sport['pulse']) 
distplot устаревшая функция вместо нее вводят
  • https://seaborn.pydata.org/generated/seaborn.histplot.html
  • https://seaborn.pydata.org/generated/seaborn.displot.html - This function provides access to several approaches for visualizing the univariate or bivariate distribution of data, including subsets of data defined by semantic mapping and faceting across multiple subplots. примеры:
penguins = sns.load_dataset("penguins")
sns.histplot(data=penguins, x="flipper_length_mm")

#sns.histplot(data=penguins, x="flipper_length_mm", bins=30)
#sns.histplot(data=penguins, x="flipper_length_mm", kde=True)
#sns.histplot(data=penguins, x="flipper_length_mm", hue="species")
иллюстрация с использованием hue

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

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