Skip to content

Repository files navigation

⚡ NSW Electricity Market — Crisis & Recovery Analysis (2022–2023)

Tools: Python · Pandas · Matplotlib · SQL · Google BigQuery
Data Source: AEMO (Australian Energy Market Operator) — Free public data
Dataset: 210,240 five-minute price & demand intervals · January 2022 – December 2023
Author: Karma Yangden · Perth, WA · LinkedIn


📌 Project Overview

In June 2022, Australia experienced its worst electricity market crisis since the 1970s oil shock. The National Electricity Market (NEM) was suspended by AEMO — only the second suspension since the market began in 1998.

This project analyses 210,000+ real data points from NSW's electricity market to answer:

  • How severe was the 2022 energy crisis in the data?
  • How did prices recover through 2023?
  • What role is renewable energy playing in the market?
  • When are prices highest and why?

🔍 Background — What Caused the Crisis?

Factor Impact
🇷🇺 Russia-Ukraine War Europe stopped buying Russian gas → bought Australian gas instead → local supply shortage
🏭 Coal plant failures ~25% of coal capacity went offline simultaneously due to ageing infrastructure
❄️ Cold winter demand June 2022 winter surge increased demand exactly when supply was falling
💰 Price cap vs costs Generation costs exceeded the market price cap → generators switched off
🛑 Market suspension AEMO suspended the NEM on 15 June 2022 and took direct control of dispatch

📊 Key Findings

Metric 2022 2023 Change
Average Price $182.72/MWh $95.94/MWh ↓ 47%
June Average Price $398.04/MWh $89.23/MWh ↓ 78%
Peak Price $15,100/MWh $16,599/MWh
% time above $300 (June) 59.5% 2.1% ↓ massive
Average Demand 7,608 MW 7,469 MW ↓ 1.8%

📁 Repository Structure

nsw-electricity-analysis/
│
├── nsw_electricity_analysis.py     ← Full Python analysis script
├── nsw_bigquery_queries.sql        ← BigQuery SQL queries
└── README.md                       ← Project overview (this file)

🗂️ Dataset

Data downloaded from AEMO's free public portal: 👉 https://www.aemo.com.au/energy-systems/electricity/national-electricity-market-nem/data-nem/aggregated-data

Column Description
REGION NEM region (NSW1)
SETTLEMENTDATE Date and time (5-minute intervals)
TOTALDEMAND Total electricity demand in MW
RRP Regional Reference Price in $/MWh
PERIODTYPE Trading interval type

📈 Analysis & Charts

# Analysis Key Finding
1 Monthly price trend 2022 vs 2023 Prices nearly halved in recovery — crisis clearly visible in June 2022
2 Price distribution comparison 2022 had far more extreme price spikes than 2023
3 Hourly price patterns Clear morning (7–9am) and evening (5–8pm) peaks every day
4 Monthly demand comparison Winter peaks in June–August, secondary summer peak in December
5 Negative price frequency Growing renewable surplus causing more negative price events in 2023
6 Price volatility over time June 2022 had the highest volatility of the entire two-year period

💡 Key Insights

1. The crisis is unmistakably visible in the data June 2022 average prices of $398/MWh — with 59.5% of intervals above the $300 cap — confirm the severity. This was not a brief spike but a sustained month-long crisis.

2. Recovery was significant but incomplete 2023 prices ($96/MWh) were 47% lower than 2022 ($182/MWh) but remain above pre-crisis averages of ~$60–70/MWh.

3. Negative prices signal the renewable energy transition Growing frequency of negative prices in 2023 shows rooftop solar increasingly exceeds grid demand during daylight hours — a structural shift requiring battery storage solutions.

4. Peak demand management is critical Consistent morning and evening price spikes highlight the need for demand-side management and time-of-use tariffs.


🛠️ How to Run

  1. Download NSW 2022 and 2023 data from AEMO (link above)
  2. Place all 24 CSV files in the same folder as the script
  3. Install dependencies: pip install pandas matplotlib
  4. Run: python nsw_electricity_analysis.py

🔗 Full Report

A complete data analysis report with 6 visualisations and written insights is available on LinkedIn.
👉 View on LinkedIn


This project was completed as part of my data analytics portfolio using real, publicly available AEMO data.

About

NSW electricity market analysis covering Australia's 2022 energy crisis and 2023 recovery — 210,000+ data points using Python and BigQuery

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages