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
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?
| 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 |
| 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% |
nsw-electricity-analysis/
│
├── nsw_electricity_analysis.py ← Full Python analysis script
├── nsw_bigquery_queries.sql ← BigQuery SQL queries
└── README.md ← Project overview (this file)
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 | 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 |
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.
- Download NSW 2022 and 2023 data from AEMO (link above)
- Place all 24 CSV files in the same folder as the script
- Install dependencies:
pip install pandas matplotlib - Run:
python nsw_electricity_analysis.py
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.