DS105 2025-2026 Autumn Term Icon

πŸ’» Week 01 Lab

Exploring Daily Temperatures with pandas

Author

Dr Jon Cardoso-Silva

Published

06 October 2025

πŸ₯… Learning Goals

By the end of this lab, you should be able to: i) Open and run a Jupyter Notebook in Nuvolos VS Code, ii) See what raw daily temperature data looks like and understand how it connects to yearly aggregated data, iii) Load a CSV into a pandas DataFrame and apply basic operations (selection, filtering, sorting), iv) Recognise patterns in daily temperatures and connect them to the Week 01 Practice summary data, v) Describe at a high level the steps to transform daily observations into yearly counts.

This lab builds directly on the πŸ“ Week 01 Practice and the πŸ–₯️ Week 01 Lecture. You will explore the raw daily temperature data behind the yearly heatwave counts.

πŸ“‹ Preparation

πŸ›£οΈ Lab Roadmap

Part Activity Type Focus Outcome
Part I πŸ—£οΈ TEACHING MOMENT From daily data to yearly insights Understand the link between daily temps and πŸ“ Week 01 Practice yearly counts
Part II 🎯 ACTION POINTS Finding hot days (β‰₯ 28Β°C) Use selection, filtering, and sorting with pandas
Part III πŸ—£οΈ TEACHING MOMENT Making the connection Describe steps to aggregate daily data into yearly counts
Self-Study 🎯 ACTION POINTS Extra exploration Extend analysis with categories and seasons

πŸ—£οΈ Introductions (15 min)

Your class teacher will run brief introductions in their preferred style.

πŸ‘‰ NOTE: Whenever you see a πŸ‘€ TEACHING MOMENT, this means your class teacher deserves your full attention!

Part I: From Daily Data to Yearly Insights (15 min)

This part of the lab is also a TEACHING MOMENT

Your class teacher will demonstrate how to open the notebook in VS Code, run cells the cells for Section 1: From Daily Data to Yearly Insights and explain what the code does.

Follow your class teacher as they:

  • Open W01-NB02-max-temperature.ipynb in VS Code inside Nuvolos.
  • Run through the code in the notebook.

🎯 ACTION POINTS

Fill out the block in the notebook that says:

Q1: How is this different from the yearly heatwave data you saw in W01 Practice?

Part II: Finding Hot Days (β‰₯ 28Β°C) (30 min)

🎯 ACTION POINTS

On your own, follow the steps below and raise your hand to your class teacher if you need help understanding something.

  1. Run all the code cells in Section 2: Finding Hot Days (β‰₯ 28Β°C)

  2. Try to see if you can understand what the code does.

    We DO NOT expect you to understand much of the code at this point. Even when your class teacher is explaining code, we do so you can familiarise yourself with the syntax (how Python code looks like and how intuitive - or not - it is to read and understand.)

  3. Answer the questions in the notebook:

    • Q2: What fraction of all days are β€œhot days” (β‰₯ 28Β°C)?
    • Q3: Do you notice any obvious patterns in the dates of the hot days?
  4. Take a moment to reflect (you can create a new Markdown cell for this):

    • Even if you don’t know anything about Python: are there things in the code that seem understandable? Similarly, are there things in the code that seem too abstract and odd?

    Make a note to yourself to come back to this notebook in two weeks’ time and see if you can understand more of the code.

Part III: Making the Connection (30 min)

This part of the lab is also a TEACHING MOMENT but your class teacher will decide on the best way to run it.

They might ask you to work in pairs or you would all - the entire class plus the class teacher - build a solution together.

🎯 ACTION POINTS

  1. Read the instructions in the Section 3: Work on the Data Science Workflow β€˜by hand’ block in the notebook.

  2. When creating your numbered list, try to be as precise as possible and think about everything that can β€œbreak” your logic.