Distribuzioni: hist, kde e box
Osservare la forma di una variabile.
Distribuzioni: hist, kde e box è una lezione Data Science Academy gratuita su CoddyKit. Questa è la lezione 2 di 4. Puoi leggere la lezione completa qui gratuitamente — poi esercitati direttamente nel browser con un editor di codice integrato e un tutor IA disponibile 24/7. Fa parte del percorso di apprendimento Data Science Academy, e i tuoi progressi si sincronizzano tra il web e l'app CoddyKit. Il corso Data Science Academy include 4 lezioni in totale.
Parti di questa lezione non sono ancora state tradotte e vengono mostrate in inglese.
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. 📈
Domande Frequenti
La lezione «Distribuzioni: hist, kde e box» è gratuita?
Sì — il testo completo di «Distribuzioni: hist, kde e box» è gratuito qui sul web. Per esercitarvi in modo interattivo (un editor di codice integrato e un tutor IA 24/7) e sbloccare il resto del corso Data Science Academy, passa a CoddyKit PRO. Il corso Data Science Academy include 4 lezioni in totale.
Cosa imparerò in «Distribuzioni: hist, kde e box»?
Osservare la forma di una variabile. Eserciti Data Science Academy con codice pratico che esegui direttamente nel browser, e un tutor IA 24/7 risponde alle tue domande mentre lavori sulla lezione.
Ho bisogno di esperienza per iniziare Data Science Academy?
Non è richiesta alcuna esperienza precedente. Data Science Academy su CoddyKit è strutturato per principianti e studenti avanzati, quindi puoi iniziare da qui o dall'inizio e procedere al tuo ritmo. Questa è la lezione 2 di 4.
Quanto tempo richiede la lezione «Distribuzioni: hist, kde e box»?
La maggior parte delle lezioni CoddyKit richiede circa 5–10 minuti. Ogni lezione è breve e interattiva, quindi fai progressi costanti e riprendi esattamente da dove hai lasciato su web e app.
Posso scrivere ed eseguire codice in questa lezione Data Science Academy?
Sì. Ogni lezione Data Science Academy include un editor di codice integrato, quindi scrivi ed esegui codice reale direttamente nel tuo browser e ricevi feedback istantaneo dall'IA — nessuna configurazione locale necessaria.
Tutte le lezioni di questo corso
- Perché seaborn invece di matplotlib puro
- Distribuzioni: hist, kde e box
- Relazioni: scatter e linee
- Facet, hue e style