BuildlyBuildly
DashboardExercisesProfileHelp
Back to all

Practice: Seaborn Distributions

Drills tagged with this skill, unpassed first. Pass them all to mark the skill ready for scenarios.

Module 4: Data Visualization

0/3 done
Exercises (0/3)
  • 1
    Histogram of Review Ratings
    Context. Twenty product reviews, rated 1-5. A histogram shows how the ratings spread — are customers happy or split? Your task. Write make_hist(df) that draws a seaborn histogram of the rating column with 5 bins, and returns the axes. Example. sns.histplot(...) with x="rating" and bins=5. Notes. Seaborn functions return the matplotlib axes they drew on — return that directly.
    7 min· 10 XP
  • 2
    Box Plot of Scores by Team
    Context. Two teams, five scores each. A box plot compares the two distributions in one look — and its center line is the median. Your task. Two parts: (1) write make_box(df) that draws a seaborn box plot with team on x and score on y, returning the axes; (2) set median_a to team A's median score, as a float. Example. The line inside team A's box sits exactly at median_a. Notes. For the median: filter the team A rows, take the score column, call .median(), wrap in float(...).
    7 min· 10 XP
  • 3
    Compare Two Groups in One Histogram
    Context. Daily step counts from users on two plans, Basic and Pro. Do Pro users actually move more? Overlay the two distributions to find out. Your task. Write make_grouped_hist(df) that draws a seaborn histogram of steps with 4 bins, split by plan using hue, and returns the axes. Example. hue="plan" colors each plan separately — and adds the legend for you. Notes. No manual legend() call needed; seaborn builds it from the hue values.
    7 min· 10 XP