AstraAI

Finding the biggest

Which day was the hottest?

In the curriculum:Arrays & vectorised mathsSee the map β†’
πŸŽ“ School maths Β· Years 4–5Statistics β€” Interpret a line graph and find the maximum value.Maths by year β†’

The Case. All week you checked the weather app and jotted down the temperature each day. Which day was the hottest β€” and can the computer spot it instantly, without you scanning the whole list? Weather forecasters sift millions of numbers exactly like this to find record-breaking days.

Your tools. numpy can find the biggest number with .max() and which day it was with .argmax().

Investigate. Press Run. The computer tells you the hottest day, and the chart shows the whole week.

  • Change the temperatures to this week's real weather.
your_code.py
Starting Python…
The Reveal

Starting Python… (first time only β€” a few seconds)

πŸ—’οΈ Detective's notes

Bundles your findings, chart and code into one PDF you can keep, print or hand in.

🧩 How this code works

The tools it uses

  • NumPy β€” a row of boxes that holds numbers, so you can do maths to all of them at once.
  • Matplotlib β€” your crayon box β€” it turns numbers into charts and pictures.

What this one does

  • β€’ It draws a line chart β€” great for change over time.
  • β€’ It finds the biggest value.

How to read it, top to bottom

  1. 1. Import β€” bring in the tools (listed above).
  2. 2. The data β€” the lists and numbers near the top. These are the bits you change.
  3. 3. The work β€” a little maths, or a loop that repeats a step.
  4. 4. Show it β€” print(...) writes words; plt.show() draws the picture.

Use it for your own problems

  • Change the numbers at the top and press Run β€” nothing breaks, so experiment!
  • Ask your own version of the question β€” swap in your family, your scores, your week.
  • The same tools work on any numbers β€” that's the superpower you're learning.