Distribuições: hist, kde e box
Visualizando o formato de uma variável.
Distribuições: hist, kde e box é uma aula grátis de Data Science Academy no CoddyKit. Esta é a aula 2 de 4. Você pode ler a aula completa abaixo gratuitamente — depois pratica ao vivo no navegador com um editor de código integrado e um tutor de IA 24/7. Faz parte do caminho de aprendizado de Data Science Academy, e seu progresso é sincronizado entre a web e o app CoddyKit. O curso de Data Science Academy inclui 4 aulas no total.
Partes desta aula ainda não foram traduzidas e aparecem em inglês.
See the Shape of One Column
Before averages, look at the whole spread. A distribution plot shows how often each value appears across a single column.
The Histogram
A histogram drops values into bins and draws a bar for each. Tall bars mark the values that show up most often.
sns.histplot(data=df, x="age")Bins Change the Story
Too few bins hide detail, too many add noise. Adjusting bins tunes how coarse or fine the histogram looks.
sns.histplot(data=df, x="age", bins=20)A Smooth Curve: KDE
A KDE plot draws a smooth curve instead of bars, estimating the density of values. It reveals the overall shape at a glance.
sns.kdeplot(data=df, x="age")Histogram Plus KDE Together
Want both the bars and the smooth line? Add kde=True to a histogram and seaborn overlays the curve for you.
sns.histplot(data=df, x="age", kde=True)Read the Peaks
One hump means a single common range, two humps hint at two groups. The number of peaks often signals hidden subgroups in your data.
The Box Plot
A box plot squeezes the distribution into five numbers: the median, the middle half, and the reach of the data.
sns.boxplot(data=df, y="income")Read the Box and Whiskers
The line inside is the median, the box is the middle 50 percent, and the whiskers stretch toward the typical extremes.
Spot Outliers Instantly
Dots beyond the whiskers are flagged as outliers. Box plots make these unusual values jump right off the screen.
Compare Groups Side by Side
Add a category to x and the box plot splits by group. Now you can compare the spread of income across each team at once.
sns.boxplot(data=df, x="team", y="income")Which Plot, When?
Reach for a histogram or KDE to see shape, and a box plot to compare groups and catch outliers fast.
Quick Check
You want to compare spread across categories and spot outliers.
Recap: Three Views of One Column
You can now read a column three ways: histograms for counts, KDE for smooth shape, and box plots for spread and outliers. 📈
Perguntas Frequentes
A aula “Distribuições: hist, kde e box” é grátis?
Sim — o texto completo de “Distribuições: hist, kde e box” é grátis para ler aqui na web. Para praticá-la interativamente (um editor de código integrado e um tutor de IA 24/7) e desbloquear o restante do curso de Data Science Academy, atualize para CoddyKit PRO. O curso de Data Science Academy inclui 4 aulas no total.
O que vou aprender em “Distribuições: hist, kde e box”?
Visualizando o formato de uma variável. Você pratica Data Science Academy com código prático que executa diretamente no navegador, e um tutor de IA 24/7 responde suas dúvidas enquanto trabalha na aula.
Preciso ter experiência prévia para começar Data Science Academy?
Nenhuma experiência prévia é necessária. Data Science Academy no CoddyKit é estruturado para alunos iniciantes até avançados, então você pode começar aqui ou desde o início e aprender no seu ritmo. Esta é a aula 2 de 4.
Quanto tempo leva a aula “Distribuições: hist, kde e box”?
A maioria das aulas CoddyKit leva cerca de 5–10 minutos. Cada uma é compacta e interativa, então você faz progresso constante e retoma exatamente de onde parou entre web e app.
Posso escrever e executar código nesta aula de Data Science Academy?
Sim. Cada aula de Data Science Academy inclui um editor de código integrado, então você escreve e executa código real direto no navegador e recebe feedback de IA instantaneamente — nenhuma configuração local necessária.
Todas as aulas deste curso
- Por que seaborn em vez de matplotlib puro
- Distribuições: hist, kde e box
- Relações: dispersão e linha
- Facetas, matiz e estilo