This document describes the analysis performed in src/gse_visual.ipynb, which is a fresh, from-scratch analysis of Ghana Stock Exchange (GSE) historical data.
The notebook loads raw CSV files from src/historical_data/ and performs the following:
- Data Loading & Validation
- Loads 37 stock CSV files (2007–2025 data)
- Validates date columns and close prices
- Builds a unified price panel
Comprehensive, reproducible analysis of historical stock data from the Ghana Stock Exchange. This repository contains the raw CSV data, an exploratory Jupyter notebook, derived charts and CSV summaries, and a short findings report used to support portfolio and research decisions related to Ghana equities.
Key outputs: cleaned price panel, daily returns, summary metrics, visualizations, and a findings summary.
- Goal: Provide an end-to-end, reproducible analysis of GSE-listed equities (2007–2025) to surface risk/return characteristics and support simple portfolio construction and research.
- Primary artifact:
src/gse_visual.ipynb— interactive analysis and processing pipeline. - Data: CSV files in
src/historical_data/(one file per ticker). A symbol reference is available ingse_reference.json.
src/src/gse_visual.ipynb— the main notebook that: loads data, cleans it, computes returns and metrics, and produces visualizations and CSV summaries.src/historical_data/— raw historical price CSVs (one per ticker).src/charts/— generated CSV summaries and chart exports (e.g.,metrics_summary.csv, allocation outputs, strategy comparison CSVs).gse_reference.json— human-readable mapping of ticker symbols to company names / metadata.FINDINGS_SUMMARY.txt— short plain-text summary of the notebook's conclusions.
README.md— this filerequirements.txt— Python dependenciesgse_reference.json— ticker metadatasrc/gse_visual.ipynb— notebooksrc/historical_data/*.csv— input data filessrc/charts/*.csvandsrc/charts/*.png— outputs
-
Clone or open this repository.
-
Create a Python virtual environment and install dependencies (bash on Windows, WSL, macOS, Linux):
# create environment
python -m venv .venv
# activate (bash / WSL)
source .venv/Scripts/activate || source .venv/bin/activate
# install
pip install -r requirements.txtIf you prefer PowerShell on Windows:
python -m venv .venv
. .venv\Scripts\Activate.ps1
pip install -r requirements.txt- Start Jupyter and open the notebook:
jupyter lab
# or
jupyter notebook- Open
src/gse_visual.ipynband run the cells top-to-bottom. The notebook will read CSVs fromsrc/historical_data/, generate metrics, and save outputs tosrc/charts/.
src/charts/metrics_summary.csv— per-ticker summary metrics (mean daily return, annualized return, annualized volatility, Sharpe proxies).- Allocation and strategy CSV exports:
etf_allocation_*.csv,etf_strategy_comparison.csv— results from portfolio/ETF allocation experiments. - Visualizations saved to
src/charts/(correlation heatmap, cumulative returns, distributions, risk-return scatter, etc.).
Key charts produced by the analysis are saved in src/charts/. They are embedded below for quick reference — open the PNG files directly for full-resolution versions.
- Correlation heatmap — correlation matrix of daily returns across all stocks
- Cumulative returns — cumulative return curves for the top stocks by annual return
- Returns distribution — histograms of daily returns for the top stocks
- Risk vs Return scatter — annualized return vs. annualized volatility for all stocks
- ETF strategy comparison (risk-return) — risk/return positions for the three allocation strategies
- Strategy comparison (bars) — Sharpe ratio and holdings comparison across strategies
- Top holdings (pie charts) — top holdings across the three strategies for visual comparison
Tip: To regenerate these charts, run
src/gse_visual.ipynbtop-to-bottom after activating the project's virtual environment.
- Load per-ticker daily price CSVs and normalize dates into a single DataFrame (price panel).
- Compute daily percentage returns, handle missing values using forward-fill then drop residual NaNs where necessary.
- Calculate annualized return and volatility using a 252-trading-day convention.
- Produce visualizations (correlation matrix, cumulative return curves, histograms) and CSV summaries for downstream analysis.
- The notebook is written to be reproducible: rerunning cells in order should recreate
src/charts/outputs. - If you add or change CSVs in
src/historical_data/, re-run the notebook cells that build the price panel and recompute metrics.
All runtime dependencies are listed in requirements.txt. The analysis uses standard scientific Python packages (pandas, numpy, matplotlib, seaborn) and Jupyter.
- Add unit tests for the data-cleaning functions (if extracted to scripts).
- Add a small CLI or Python script to programmatically regenerate charts for CI.
- Expand analysis: sector-level aggregation, dividend-adjusted returns, factor regressions, or backtests for simple strategies.
This analysis is for educational and informational purposes only. It is not financial advice. Past performance does not guarantee future results. Always conduct your own research and consult with a qualified financial advisor before making investment decisions.
- Ghana Stock Exchange for market data
- Plotly for visualization capabilities
- The Python data science community
- This project was developed as part of a data analysis initiative to provide insights into the Ghana Stock Exchange. Special thanks to the contributors and the open-source community for the tools and libraries used.
- Open an issue for any data problems, requests, or improvements.
- If you're submitting code, please target the
mainbranch via pull request and include a short description and repro steps.
- This project is provided under the repository
LICENSEfile. Review it for permitted usage.
- Wisdom Dosoo GitHub Profile
For questions or suggestions, please open an issue or reach out at dosoowisdom1@gmail.com






