Rainfall Patterns Across the Continent Africa Jan-May 2026
# Rainfall Patterns Across the Continent of Africa (Jan–May 2026)
## Overview
This project is a mini exploratory data analysis (EDA) of rainfall patterns
across five African cities — Cairo, Casablanca, Lagos, Nairobi, and
Johannesburg — covering the period from January to May 2026. The goal is to
understand how rainfall varies by city, geography (coastal vs inland, North
vs South hemisphere), and time, as a starting point for thinking about water
availability and scarcity across the continent.
## Dataset
- **Source**: Worldwide Weather 2026: Daily City Weather Data
(downloaded from Kaggle)
- **Underlying data provider**: Open-Meteo Historical Weather API
- **Raw file**: `worldwide_weather_2026_to_2026-05-05.csv`
- **Cleaned output**: `africa_rainfall_cleaned.csv`
## Project Structure
```
.
├── rainfall_patterns_across_the_continent_africa.py # Analysis script
├── Rainfall_Patterns_Across_the_Continent_Africa.pptx # Presentation deck
├── worldwide_weather_2026_to_2026-05-05.csv # Dataset from Kaggle
├── africa_rainfall_cleaned.csv # Cleaned dataset (generated)
└── README.md # This file
```
## What the Script Does
### 1. Data Loading
Loads the raw weather CSV from Google Drive (via Colab).
### 2. Data Cleaning
- Checks for duplicate dates and confirms each date corresponds to multiple
locations (one row per city per date).
- Converts the `date` column from string to datetime.
- Checks for null values across all columns.
- Filters the dataset down to cities in the `Africa` continent only.
- Selects a focused subset of columns relevant to rainfall analysis:
`city`, `country`, `continent`, `latitude`, `longitude`, `coastal_city`,
`date`, `precipitation_sum`, `rain_sum`, `season`.
### 3. Feature Engineering
- Adds a `hemisphere` column (`North` / `South`) derived from `latitude`,
since Africa spans both hemispheres.
- Converts `season` to a categorical type for memory efficiency.
- Converts …