Files
Tirsvad 1d06a2c892 Add notebook, step screenshots, README screenshots and three-language wiki
Closes #18
Closes #19
Closes #20
Closes #21
Closes #22
Closes #23
Closes #24
Refs #25

Task: MIL-003#1
2026-11-12 08:45:20 +08:00

1.0 KiB

English · Dansk · Bahasa Malaysia

Step 1: Exploring the brick colours

Question: How many colours does LEGO make, and how many are transparent?

Step 1: Exploring the brick colours

What the code does

count_unique_colours uses .nunique() on the name column: 135 colours. transparent_counts_groupby (.groupby("is_trans").count()) and transparent_counts_value_counts (.value_counts()) give the same answer in two ways: 107 opaque and 28 transparent colours.

What you gained

  • Reading a CSV with pd.read_csv and looking at it with .head().
  • .nunique() counts distinct values.
  • The same question can be answered with .groupby().count() or .value_counts(); .value_counts() is the shortcut for counting categories.

Previous: Getting-Started · Next: Step-2-Sets