In this lesson, you'll process the data you collected in the previous lesson and implement algorithms to analyse it. This builds on your hypothesis and prepares you for building the full analytics artefact.
We'll guide you through reviewing your data, cleaning it, exploring patterns, selecting and coding algorithms, evaluating results, and documenting your work. By the end, you'll have initial insights from your data analysis.
Begin by examining the dataset from your previous lesson. Check for completeness, structure, and relevance to your hypothesis.
Key Checks:
import csv
# Example: Load data from CSV
data = []
with open('your_data.csv', 'r') as file:
reader = csv.reader(file)
for row in reader:
data.append(row)
print(data[:5]) # Print first 5 rows
Handle any issues found in the review. Clean the data to make it ready for analysis. This step is crucial for structuring and transforming raw data to prepare it for analysis (outcome 3.5).
Steps:
Use statistics and visualisations to understand your data's patterns, trends, and relationships.
Approach:
# Assume cleaned_data has numeric values in index 1
values = [row[1] for row in cleaned_data]
mean = sum(values) / len(values)
print('Mean:', mean)
# Simple text visualization
print('Histogram:')
for i in range(0, max(values)+1, 5):
count = sum(1 for v in values if i <= v < i+5)
print(f'{i}-{i+4}: ' + '*' * count)
You're previewing this lesson. Get full access to this lesson and hundreds more — each one ready to teach, with interactive activities, printable resources and pupil progress tracking built in.