This project uses Python and Jupyter Notebook to scrape, clean, analyze, and predict data for the Africa Cup of Nations (AFCON) 2023, a biennial African association football tournament. The project aims to provide insights and findings about the tournament, such as the historical performance, and match outcome of the 24 participating teams.
# AFCON 2023 Data Analysis and Prediction
This project scrapes data for the Africa Cup of Nations (AFCON) 2023, a biennial African association football tournament organised by Confederation of African Football (CAF). It then cleans up the data and performs some exploratory data analysis and prediction using Python and Jupyter Notebook.
## Overview
The AFCON 2023 is scheduled to take place from 13 January to 11 February 2024 in Ivory Coast. It will be the 34th edition of the tournament and the second time that Ivory Coast hosts the finals. The tournament will feature 24 teams that qualified from the preliminary rounds.
The aim of this project is to collect and analyze data related to the AFCON 2023, such as the teams, fixtures, results, and statistics. The project also attempts to predict the outcome of the matches and each round of the tournament using historical data and the Poisson distribution.
## Features
- Data scraping: The project uses the requests and BeautifulSoup libraries to scrape historical, fixture, and groups data from Wikipedia. The data is then stored in CSV files for further processing, while the groups are dumped as binary (with pickle).
- Data cleaning: The project uses the pandas library to clean and manipulate the data, such as removing duplicates, handling missing values, and merging data frames.
- Data prediction: The project uses the Poisson distribution to model the number of goals scored by each team in a match, and then calculates the probabilities of different outcomes, such as win, draw, or loss. The project also uses the points system to rank the teams and predict the winner of the tournament.
- Data visualization: The project visualizes the average predicted points for all teams based on historical data in a bar graph, using plotly express.
## Installation
The following packages are required to run the code in this repository:
- pandas, beautifulsoup4, requests, time, pickle, scipy, numpy, plotly
1. Clone this repository to …