# Well & Reservoir Classification — SPE Africa DSEATS Datathon 2025
Reservoir engineering analysis pipeline built for the **SPE Africa DSEATS Datathon 2025**. Given raw well production data and reservoir properties, this notebook cleans the data and derives a set of engineering diagnostics used to classify well and reservoir behavior.
## What it does
Starting from three raw datasets (well production history, reservoir properties, and classification parameters), the pipeline:
1. **Cleans the data** — strips comma-formatted numeric strings, converts to proper dtypes, parses production dates, and checks for missing values.
2. **Reservoir saturation status** — compares initial reservoir pressure to bubble point pressure to classify each reservoir as *Saturated* or *Undersaturated*.
3. **Well-to-reservoir assignment (Task 1)** — for each well, takes the maximum bottomhole flowing pressure (BHP) over its production history and assigns it to the reservoir whose current average pressure is within ±200 psi.
4. **Well EDA** — per-well plots of oil/gas/water production rates, gas-oil ratio (GOR), and watercut over time.
5. **Productivity Index (PI) trend** — computes daily oil rate, pressure drawdown, and PI (STB/day/psi), then uses linear regression to classify each well's PI trend as Flat, Increasing, or Decreasing.
6. **Watercut trend** — same regression-based classification approach applied to watercut over time.
7. **Reservoir barrels produced** — converts cumulative stock-tank oil production to reservoir barrels using each reservoir's formation volume factor (FVF), then aggregates by reservoir.
8. **Well type classification** — classifies wells as Naturally Flowing (NF) or Gas Lifted (GL) based on annulus pressure.
9. **Formation GOR trend** — computes formation gas-oil ratio (FGOR) using cumulative gas production and the reservoir's solution GOR (Rs).
## Data
The notebook expects three CSV files (originally uploaded via Colab's file picker):
| File | Description …