{
  "cells": [
    {
      "cell_type": "markdown",
      "id": "welcome",
      "metadata": {},
      "source": ["# DASKEREL · Data analysis foundations\n", "**Linked learning:** introductory data and Python practice.\n", "\n", "Use a small, invented weekly study-time dataset. No files, packages, personal data, Drive access or network request are needed. Predict each result before running.\n", "\n", "**Goals:** check data quality, compare mean and median, recognise an outlier and explain limits of interpretation."]
    },
    {
      "cell_type": "markdown",
      "id": "inspect-notes",
      "metadata": {},
      "source": ["## 1. Inspect the records\n", "Each number is a fictional count of study minutes. A missing value is represented by `None`; do not silently treat it as zero. Count usable records before calculating any average."]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "id": "inspect-code",
      "metadata": {},
      "outputs": [],
      "source": ["minutes = [25, 30, None, 35, 40, 30, 120]\n", "usable = [value for value in minutes if value is not None]\n", "print('Recorded:', len(minutes))\n", "print('Usable:', len(usable))\n", "print('Missing:', len(minutes) - len(usable))\n", "\n", "assert len(usable) == 6\n", "assert len(minutes) - len(usable) == 1"]
    },
    {
      "cell_type": "markdown",
      "id": "summary-notes",
      "metadata": {},
      "source": ["## 2. Compare measures\n", "The **mean** uses every usable value. The **median** is the middle of the sorted values, or the mean of the two middle values when there is an even count. Predict which measure will be more affected by 120."]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "id": "summary-code",
      "metadata": {},
      "outputs": [],
      "source": ["from statistics import mean, median\n", "\n", "average = mean(usable)\n", "middle = median(usable)\n", "print('Mean minutes:', round(average, 1))\n", "print('Median minutes:', middle)\n", "print('Sorted values:', sorted(usable))\n", "\n", "assert round(average, 1) == 46.7\n", "assert middle == 32.5"]
    },
    {
      "cell_type": "markdown",
      "id": "outlier-notes",
      "metadata": {},
      "source": ["## 3. Test an explanation\n", "Temporarily remove 120 and compare the new mean. This shows its effect, but **do not delete a real observation merely because it is unusual**. Investigate how a real value was collected first."]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "id": "outlier-code",
      "metadata": {},
      "outputs": [],
      "source": ["without_120 = [value for value in usable if value != 120]\n", "print('Mean with all usable values:', round(mean(usable), 1))\n", "print('Mean in sensitivity check:', round(mean(without_120), 1))\n", "\n", "assert len(without_120) == 5\n", "assert mean(without_120) == 32"]
    },
    {
      "cell_type": "markdown",
      "id": "challenge",
      "metadata": {},
      "source": ["## 4. Your investigation\n", "1. Replace one `None` with a plausible invented number and rerun every cell. Describe how many records are now usable.\n", "2. Add a second unusual value and compare mean and median again.\n", "3. Write two sentences: what the numbers show, and what they cannot tell us about the learners or causes of study time.\n", "4. Record source, missing-value rule and changes before sharing any result. This notebook is practice, not a validated research dataset."]
    }
  ],
  "metadata": {"kernelspec": {"display_name": "Python 3", "language": "python", "name": "python3"}, "language_info": {"name": "python"}},
  "nbformat": 4,
  "nbformat_minor": 5
}
