RivoCode

Intro to Data Science · Visualization · Lesson 6 of 12

Bar Charts and Histograms

Concept

Bar Charts and Histograms

Bar charts compare categories, while histograms show the distribution of a single numeric column.

By the end of this lesson
  • Explain the core idea behind Bar Charts and Histograms.
  • Predict output before running a change.
  • Test one realistic and one unusual input.
  • Use the result to make the next decision.
How to study this page
  1. 1. Read one concept.
  2. 2. Change the example.
  3. 3. Run, compare, and explain.
  4. 4. Complete the challenge below.
ExampleRunnable
df["category"].value_counts().plot(kind="bar")
df["age"].plot(kind="hist")
Try it Yourself »
Self-check before continuing

Without looking at the example, describe what changes when you modify one input in Bar Charts and Histograms. Then reopen the editor and prove your explanation with a small test.

You are ready to continue when you can predict, test, and explain the result.

Your turn

Explain when you would choose a histogram over a bar chart.

Loading editor…

Console

Output will appear here...