Nigerian Datasets Deep Dive
Why Local Data Matters
A portfolio full of the Titanic and Iris datasets looks like everyone else's. A portfolio that analyses Naira exchange rate volatility, state-level tax revenue or NIN enrolment gaps shows an employer in Lagos, Abuja or Nairobi that you understand the market they operate in. Global employers value it too, because it proves you can find, clean and interpret real, messy public data on your own.
This lesson maps out the most useful Nigerian public data sources, what each one really measures, and how to load it into pandas.
1. Central Bank of Nigeria (CBN): Exchange Rates and Monetary Data
Where: cbn.gov.ng, under the Rates and Statistics sections.
What you get:
- Daily exchange rates for the Naira against USD, GBP, EUR, CNY and others
- The monetary policy rate (MPR), interbank rates and Treasury bill rates
- The CBN Statistical Bulletin: a large set of Excel workbooks covering money supply, credit to the private sector, external reserves, balance of payments and more
How to load: download the Excel or CSV file, then read it with pandas. CBN files often have title rows above the real header, so inspect the file first.
import pandas as pd
# Downloaded from the CBN exchange rate page. Adjust the filename and skiprows to match your file
fx = pd.read_csv("cbn_exchange_rates.csv")
fx.columns = fx.columns.str.strip().str.lower().str.replace(" ", "_")
fx["rate_date"] = pd.to_datetime(fx["rate_date"], dayfirst=True)
usd = fx[fx["currency"].str.contains("US DOLLAR", case=False)]
usd = usd.set_index("rate_date").sort_index()
usd["central_rate"].plot(title="Naira per US Dollar (CBN central rate)")
Watch out for: the exchange rate regime changed in 2023, when the official windows were unified, so there is a structural break in the series. Any model or chart spanning that period must account for it.
2. Federal Inland Revenue Service (FIRS): Tax Revenue
Where: firs.gov.ng publishes annual reports and revenue announcements. The NBS also publishes quarterly reports on Value Added Tax (VAT) and Company Income Tax (CIT) that are compiled from FIRS data, often broken down by sector.
What you get: total collections, and splits by tax type (CIT, VAT, Petroleum Profits Tax, Stamp Duties) and by sector.
How to load: these reports are usually PDFs or Excel tables. For PDFs, the camelot or tabula-py libraries can extract tables:
# pip install camelot-py (in Colab: !pip install camelot-py)
import camelot
tables = camelot.read_pdf("nbs_vat_q1_2025.pdf", pages="3-5")
vat = tables[0].df # each table becomes a DataFrame
vat.columns = vat.iloc[0] # promote the first row to the header
vat = vat.drop(index=0)
Watch out for: amounts in different units (N billion versus N million), and oil versus non-oil revenue being reported separately.
3. NIMC: National Identity Enrolment
Where: nimc.gov.ng publishes NIN enrolment statistics, typically total enrolment and breakdowns by state, gender and age band.
Important distinction: NIMC data measures how many people have enrolled for a NIN, not how many people live in Nigeria. Nigeria's official population figures come from the National Population Commission (NPC) and NBS projections, and the World Bank (SP.POP.TOTL) and UN publish estimates too. Nigeria's last full census was in 2006, so every current population figure is a projection.
A powerful analysis combines the two:
enrol = pd.read_excel("nimc_enrolment_by_state.xlsx") # NIMC table
pop = pd.read_csv("state_population_projection.csv") # NBS/NPC projection
coverage = enrol.merge(pop, on="state")
coverage["nin_coverage_pct"] = coverage["enrolled"] / coverage["population"] * 100
coverage.sort_values("nin_coverage_pct").head(10) # states with the lowest coverage
That one metric, NIN coverage by state, is a genuinely useful policy and fintech insight: banks and fintechs need NINs for customer onboarding (KYC).
4. National Bureau of Statistics (NBS)
Where: nigerianstat.gov.ng, in its e-library.
What you get: the CPI and inflation reports (monthly), GDP (quarterly), labour force statistics, foreign trade, and the Nigeria Living Standards Survey.
Tip: for long time series, the World Bank API (covered in the previous lesson) is often easier to load than NBS PDFs, and it draws on the same underlying data.
5. Other High-Value Sources
| Source | What is there |
|---|---|
| Nigerian Exchange Group (NGX) (ngxgroup.com) | Daily prices and volumes for listed companies such as Dangote Cement, MTN Nigeria, Zenith Bank and GTCO |
| Humanitarian Data Exchange (HDX) (data.humdata.org) | Nigeria health, population, displacement and administrative boundary data, often in clean CSV form |
| Zindi (zindi.africa) | African data science competitions with ready-made datasets |
| Kaggle | Community-uploaded Nigerian datasets (check their sources carefully) |
| NCC (ncc.gov.ng) | Telecom subscriber and internet penetration data by operator |
| NDIC and SEC | Banking sector and capital market statistics |
A Checklist for Any Public Dataset
- Units: Naira or USD? Thousands, millions or billions?
- Definitions: what exactly is counted? (enrolment is not population)
- Time coverage: are there gaps or methodology changes?
- Revisions: GDP and inflation figures are often revised. Record the date you downloaded the data
- Licence: can you publish your analysis? Most government data can be used with attribution
- Save the raw file: keep the original download next to your notebook so your work is reproducible
Open in Google Colab
Start a notebook called "Nigeria Data Explorer". Load one dataset from this lesson, apply the checklist above in a markdown cell, and produce one chart. This becomes your first portfolio piece.
Try it yourself
Key Takeaways
- Nigerian datasets make your portfolio stand out and prove you can work with real, messy public data.
- CBN publishes exchange rates, interest rates and the Statistical Bulletin; FIRS and NBS publish tax revenue by type and sector; NIMC publishes NIN enrolment statistics.
- Understand what each dataset really measures: NIN enrolment is not population, and telecom subscriptions are not unique people.
- Government data often arrives as PDFs and Excel files with title rows, so camelot, read_excel with skiprows, and column renaming are essential tools.
- Check units, definitions, time coverage, revisions and licence for every public dataset, and keep the raw download for reproducibility.
Quick Quiz
1.You divide NIMC's number of NIN enrolments by a state's population. What are you measuring?
2.Why must an analysis of the Naira exchange rate take special care around 2023?
3.An NBS tax report is published only as a PDF. Which tool helps you extract its tables into pandas?
Ready to go further?
CareerEx gives you structured 12-week training, live classes every Saturday and Sunday, real tutor feedback, and a certificate. Join the next cohort.
Join CareerEx