π₯οΈ Week 05 Lecture
Summarising and Presenting Data
π Logistics
πLocation: Thursday, 19 February 2026, 4-6 pm at CKK.LG.03
Last week you struggled with nested np.where() and boolean columns in the W04 Lab when classifying weather. Today, youβll learn a much cleaner approach through custom functions, then discover how to summarise temporal data to reveal insights. Finally, youβll learn to present summary tables using pandas Styler.
π Preparation
- Complete the π» W04 Lab (pair programming!)
- Continue working on βοΈ Mini-Project 1 (released last week)
- The skills you learn today will directly support your Mini-Project 1 work
π£οΈ Lecture Overview
Part 1: From Loops to Functions (35 min)
- Custom functions with
defto replace nestednp.where() .apply()for processing entire datasets- π Quick challenge (if time permits)
Part 2: Temporal Data (25 min)
- DateTime conversion and the
.dtaccessor
BREAK (10 min)
Part 3: GroupBy & Presenting Data with pandas Styler (40 min)
.groupby()aggregations by year, month, day.style.format(),.background_gradient(),.bar(),.set_caption()- π Compression Challenge (if time permits)
π Lecture Materials
Todayβs lecture uses slides with a demonstration notebook for live coding. All materials will be available in your Nuvolos workspace under the week05/ folder, or you can download them directly below.
π¬ Lecture Slides
Use keyboard arrows to navigate. Select the slides below or view fullscreen.
Or download the slides directly as a PDF:
Lecture Demonstration Notebook
This notebook accompanies the slides with code examples you can run yourself.
Data Files
The lecture uses extended W04 weather data (20 years of temperature and rainfall):
π‘ Key Concepts
- Custom functions: Extract complex logic into testable, reusable code
.apply()method: Process entire datasets without explicit loops- DateTime operations: Convert timestamps and extract date components
.groupby()aggregations: Summarise data by categories or time periods- pandas Styler: Format, colour, and caption summary tables for presentation
- Narrative titles: State your findings, donβt describe the data
π Appendix
PostβLecture Actions
- Complete the π» W05 Lab (seaborn & matplotlib)
- Start translating your loop-based NB02 code to vectorised operations
- Consider using styled DataFrames for your NB03 insights
- Post questions in
#helpon Slack
Useful Links
- π» W04 Lab (reference for nested
np.where()struggles) - π» W05 Lab (matplotlib & seaborn essentials)
- βοΈ Mini-Project 1 (due W06)
Using Nuvolos- π Syllabus
Looking Ahead
- Tomorrow (W05 Friday): Matplotlib & seaborn lab
- Mini-Project 1: Ongoing, keep collecting data and experimenting
- Week 06: Reading Week, focus time for Mini-Project 1 completion
- Deadline: W06 Thursday 8pm (submit via GitHub)
