Sitemap

Member-only story

Analysing the Ghana Cedi Exchange Rate Over Time

5 min read2 days ago

--

A real-data project with pandas: levels, percentage changes and context

Press enter or click to view image in full size

Few numbers in Ghana are discussed as often as the exchange rate. Traders watch it, importers plan around it, students abroad and their families feel it, and it shapes the price of almost everything in the market. That makes it a perfect first project: real data, a question people care about, and a few analysis traps that teach important lessons.

In this article, we load the official exchange rate, chart it, measure how fast it changed, and look at what the numbers can and cannot tell us.

Getting the data

We will use the World Bank’s official exchange rate series for Ghana, which reports the average number of cedis per US dollar for each year. As we saw in part 4, the World Bank API makes this a few lines of code:

import pandas as pd
import requests
url = ("https://api.worldbank.org/v2/country/GHA/indicator/PA.NUS.FCRF"
"?format=json&per_page=100")
meta, records = requests.get(url, timeout=30).json()
fx = (pd.DataFrame([{"year": int(r["date"]), "ghs_per_usd": r["value"]} for r in records])
.dropna()
.sort_values("year")
.query("year >= 2000")
.reset_index(drop=True))
fx.tail()

--

--

Clemence Ayekple
Clemence Ayekple

Written by Clemence Ayekple

Assistant Systems Analyst at the University of Cape Coast | MSc Computer Science | Making ML beginner-friendly and the web accessible to everyone.