Skip to content

BusraCevik/numpy-climate-analyzer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Climate Change Analyzer with NumPy

Description

This project analyzes global land temperature data using only NumPy (originally designed to work solely with NumPy).
It performs statistical analysis, trend estimation, anomaly detection,
and time-based aggregation to explore climate change patterns. Later, optional visualization features using Matplotlib and Plotly were added to generate static plots and interactive country-level maps.


Example Outputs

Yearly Temperature Trend

Yearly Trend

Yearly Anomalies

Yearly Anomalies

Yearly Summary

Yearly Anomalies

Country Map Preview

Interactive Map Video

Interactive Country Map

Interactive Country Map (Live)


Dataset

This project uses the Climate Change: Earth Surface Temperature Data dataset from Kaggle.
It contains historical land temperature records from around the world, collected and published by Berkeley Earth.
The dataset provides daily and monthly temperature observations dating back to the 1700s, which we use to analyze long‑term trends and anomalies.


Features

  • Data cleaning and preprocessing with NumPy
  • Statistical climate profiling (mean, std, variance, yearly averages)
  • Global warming trend analysis using linear regression
  • Climate anomaly detection using sigma thresholds
  • Yearly temperature aggregation
  • Extreme years identification (hottest and coldest years)
  • CSV export of yearly summaries
  • Visualization of yearly trends and anomalies (saved as PNGs)

Technologies

  • Python 3.x
  • NumPy
  • Matplotlib (for visualization)
  • Plotly

Project Structure

climate_analyzer/
│
├── data/                     # Datasets
│   ├── climate.csv
│   └── climate_by_country.csv
│
├── data/outputs/             # Generated files
│   ├── yearly_summary.csv
│   ├── yearly_summary.png
│   ├── yearly_trend.png
│   └── yearly_anomalies.png
│
├── src/                      # Modular code
│   ├── aggregations.py       # Yearly aggregation functions
│   ├── anomalies.py          # Anomaly detection functions
│   ├── loader.py             # Data loading & cleaning
│   ├── statistics.py         # Basic statistics functions
│   ├── trends.py             # Trend analysis functions
│   └── plotting.py           # Visualization functions
│
├── docs/                      
│   ├── interactive_country_map.html
│   └── interactive_country_map_demo.gif
│
├── main_unmodularized.py     # Original version before modularization
├── main.py                   # Modularized version
└── README.md

Development History

  1. Initial Version (main_unmodularized.py)

    • All code was written in a single file
    • Basic statistics, yearly aggregation, anomalies, trend analysis, and extreme years detection
    • Terminal output only
  2. Modular Version (main.py)

    • Code refactored into reusable functions in src/
    • CSV export of yearly summaries
    • Visualizations of yearly trends and anomalies saved to data/
    • Easier maintenance and scalability

Use Case

This project demonstrates how large-scale numerical datasets
can be processed efficiently using only NumPy without external libraries.
It also shows a workflow from raw data analysis to modular, reusable code
with persistent outputs (CSV, PNGs) for further analysis or reporting.

About

Built a climate data analysis system using NumPy to analyze global temperature trends, anomalies, and statistical patterns.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages