Um momento
0x30Lesson 4 of 5

Choose a useful visualization

Match charts to comparisons, distributions, and relationships.

12 min 3-question quiz 1 code exercise
By the end of this lesson you can
  • Choose a chart type that makes the intended comparison readable.

Charts make patterns easier to see when their visual form matches the question. Use a histogram to inspect the distribution of one numeric variable, a bar chart to compare categories, and a scatter plot to examine the relationship between two numeric variables. Label axes with units, show meaningful scales, and avoid design choices that exaggerate differences.

analysis.py
temperatures = [18, 19, 19, 21, 24, 24, 25]
counts = {value: temperatures.count(value) for value in sorted(set(temperatures))}
print(counts)
Output
{18: 1, 19: 2, 21: 1, 24: 2, 25: 1}

A chart should make the question and evidence legible. Include a clear title, axis labels, units, and relevant context. A visualization can reveal an association, but it does not by itself identify a cause.

Key takeaways

  • Choose a chart type that makes the intended comparison readable.

  • Check how the data was collected before drawing conclusions.

  • Explain important assumptions and limitations.

Lesson quiz

3 questions · pass with 3 correct · up to 50 XP

Passing this quiz completes the lesson and keeps your streak going. Questions you miss come back in review sessions later.

Practice: write Python

Write Python in the editor and run it against sample inputs. Python runs locally in your browser using a WebAssembly runtime.

Exercise 1

Build category counts

+25 XP

Read a JSON array of category strings. Print each distinct category and its count in alphabetical order, one per line as category count.

  • Repeated labels
  • One category
main.py
Loading editor…

Python runs in a sandboxed browser worker with a 60 second time limit. Its runtime loads from the Pyodide CDN; your code stays in this browser.

Questions about this lesson

Stuck? Ask. Figured something out? Share it. Explaining is one of the best ways to learn.

Loading posts…

Gostou da aula? 😆👍
Apoie nosso trabalho com uma doação: