{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# ELO Team Ratings Data Parsing\n", "##### Notebook to parse team rating data from landed from [Club ELO](http://clubelo.com/) through their API.\n", "\n", "### By [Edd Webster](https://www.twitter.com/eddwebster)\n", "Notebook first written: 02/09/2021
\n", "Notebook last updated: 04/09/2021\n", "\n", "![title](../../img/logos/elo.png)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "___\n", "\n", "\n", "\n", "## Introduction\n", "This notebook engineers transfer data data from [Club ELO](http://clubelo.com/), and manipulates this landed data as DataFrames using [pandas](http://pandas.pydata.org/) and [matplotlib](https://matplotlib.org/) for visualisation.\n", "\n", "For more information about this notebook and the author, I'm available through all the following channels:\n", "* [eddwebster.com](https://www.eddwebster.com/);\n", "* edd.j.webster@gmail.com;\n", "* [@eddwebster](https://www.twitter.com/eddwebster);\n", "* [linkedin.com/in/eddwebster](https://www.linkedin.com/in/eddwebster/);\n", "* [github/eddwebster](https://github.com/eddwebster/);\n", "* [public.tableau.com/profile/edd.webster](https://public.tableau.com/profile/edd.webster);\n", "* [kaggle.com/eddwebster](https://www.kaggle.com/eddwebster); and\n", "* [hackerrank.com/eddwebster](https://www.hackerrank.com/eddwebster).\n", "\n", "![title](../../img/fifa21eddwebsterbanner.png)\n", "\n", "The accompanying GitHub repository for this notebook can be found [here](https://github.com/eddwebster/football_analytics) and a static version of this notebook can be found [here](https://nbviewer.jupyter.org/github/eddwebster/football_analytics/blob/master/notebooks/A%29%20Web%20Scraping/TransferMarkt%20Web%20Scraping%20and%20Parsing.ipynb)." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "___\n", "\n", "\n", "\n", "## Notebook Contents\n", "1. [Notebook Dependencies](#section1)
\n", "2. [Project Brief](#section2)
\n", "3. [Data Sources](#section3)
\n", " 1. [Introduction](#section3.1)
\n", " 2. [Data Dictionary](#section3.2)
\n", " 3. [Creating the DataFrame](#section3.3)
\n", " 4. [Initial Data Handling](#section3.4)
\n", " 5. [Export the Raw DataFrame](#section3.5)
\n", "4. [Data Engineering](#section4)
\n", " 1. [Introduction](#section4.1)
\n", " 2. [Columns of Interest](#section4.2)
\n", "5. [Exploratory Data Analysis (EDA)](#section5)
\n", " 1. [...](#section5.1)
\n", " 2. [...](#section5.2)
\n", " 3. [...](#section5.3)
\n", "6. [Summary](#section6)
\n", "7. [Next Steps](#section7)
\n", "8. [Bibliography](#section8)
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "___\n", "\n", "\n", "\n", "## 1. Notebook Dependencies\n", "This notebook was written using [Python 3](https://docs.python.org/3.7/) and requires the following libraries:\n", "* [`Jupyter notebooks`](https://jupyter.org/) for this notebook environment with which this project is presented;\n", "* [`NumPy`](http://www.numpy.org/) for multidimensional array computing;\n", "* [`pandas`](http://pandas.pydata.org/) for data analysis and manipulation; and\n", "* [`matplotlib`](https://matplotlib.org/contents.html?v=20200411155018) for data visualisations.\n", "\n", "All packages used for this notebook except for BeautifulSoup can be obtained by downloading and installing the [Conda](https://anaconda.org/anaconda/conda) distribution, available on all platforms (Windows, Linux and Mac OSX). Step-by-step guides on how to install Anaconda can be found for Windows [here](https://medium.com/@GalarnykMichael/install-python-on-windows-anaconda-c63c7c3d1444) and Mac [here](https://medium.com/@GalarnykMichael/install-python-on-mac-anaconda-ccd9f2014072), as well as in the Anaconda documentation itself [here](https://docs.anaconda.com/anaconda/install/)." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Import Libraries and Modules" ] }, { "cell_type": "code", "execution_count": 170, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Setup Complete\n" ] } ], "source": [ "# Python ≥3.5 (ideally)\n", "import platform\n", "import sys, getopt\n", "assert sys.version_info >= (3, 5)\n", "import csv\n", "\n", "# Import Dependencies\n", "%matplotlib inline\n", "\n", "# Math Operations\n", "import numpy as np\n", "import math\n", "from math import pi\n", "\n", "# Datetime\n", "import datetime\n", "from datetime import date, timedelta\n", "import time\n", "\n", "# Data Preprocessing\n", "import pandas as pd\n", "#import pandas_profiling as pp\n", "import os\n", "import re\n", "import random\n", "from io import BytesIO, StringIO\n", "from pathlib import Path\n", "\n", "# Reading directories\n", "import glob\n", "import os\n", "from os.path import basename\n", "\n", "# Flatten lists\n", "from functools import reduce\n", "\n", "# Working with JSON\n", "import json\n", "from pandas.io.json import json_normalize\n", "\n", "# Web Scraping\n", "import requests\n", "from requests.adapters import HTTPAdapter\n", "from requests.packages.urllib3.util.retry import Retry\n", "from bs4 import BeautifulSoup\n", "import re\n", "\n", "# Currency Convert\n", "from forex_python.converter import CurrencyRates\n", "\n", "# Data Visualisation\n", "import matplotlib as mpl\n", "import matplotlib.pyplot as plt\n", "import seaborn as sns\n", "plt.style.use('seaborn-whitegrid')\n", "import missingno as msno\n", "\n", "# Progress Bar\n", "from tqdm import tqdm\n", "\n", "# Display in Jupyter\n", "from IPython.display import Image, YouTubeVideo\n", "from IPython.core.display import HTML\n", "\n", "# Ignore Warnings\n", "import warnings\n", "warnings.filterwarnings(action=\"ignore\", message=\"^internal gelsd\")\n", "\n", "print('Setup Complete')" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "scrolled": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Python: 3.7.6\n", "NumPy: 1.20.3\n", "pandas: 1.3.2\n", "matplotlib: 3.4.2\n" ] } ], "source": [ "# Python / module versions used here for reference\n", "print('Python: {}'.format(platform.python_version()))\n", "print('NumPy: {}'.format(np.__version__))\n", "print('pandas: {}'.format(pd.__version__))\n", "print('matplotlib: {}'.format(mpl.__version__))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Defined Filepaths" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "# Set up initial paths to subfolders\n", "base_dir = os.path.join('..', '..', )\n", "data_dir = os.path.join(base_dir, 'data')\n", "data_dir_elo = os.path.join(base_dir, 'data', 'elo')\n", "img_dir = os.path.join(base_dir, 'img')\n", "fig_dir = os.path.join(base_dir, 'img', 'fig')\n", "video_dir = os.path.join(base_dir, 'video')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Defined Variables" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "# Defined Variables\n", "\n", "## Define today's date\n", "today = datetime.datetime.now().strftime('%d/%m/%Y').replace('/', '')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Defined Dictionaries" ] }, { "cell_type": "code", "execution_count": 139, "metadata": {}, "outputs": [], "source": [ "# Defined Dictionaries\n", "\n", "## Define seasons\n", "dict_seasons = {1975: '1975/1976',\n", " 1976: '1976/1977',\n", " 1977: '1977/1978',\n", " 1978: '1978/1979',\n", " 1979: '1979/1980',\n", " 1980: '1980/1981',\n", " 1981: '1981/1982',\n", " 1982: '1982/1983',\n", " 1983: '1983/1984',\n", " 1984: '1984/1985',\n", " 1985: '1985/1986',\n", " 1986: '1986/1987',\n", " 1987: '1987/1988',\n", " 1988: '1988/1989',\n", " 1989: '1989/1990',\n", " 1990: '1990/1991',\n", " 1991: '1991/1992',\n", " 1992: '1992/1993',\n", " 1993: '1993/1994',\n", " 1994: '1994/1995',\n", " 1995: '1995/1996',\n", " 1996: '1996/1997',\n", " 1997: '1997/1998',\n", " 1998: '1998/1999',\n", " 1999: '1999/2000',\n", " 2000: '2000/2001',\n", " 2001: '2001/2002',\n", " 2002: '2002/2003',\n", " 2003: '2003/2004',\n", " 2004: '2004/2005',\n", " 2005: '2005/2006',\n", " 2006: '2006/2007',\n", " 2007: '2007/2008',\n", " 2008: '2008/2009',\n", " 2009: '2009/2010',\n", " 2010: '2010/2011',\n", " 2011: '2011/2012',\n", " 2012: '2012/2013',\n", " 2013: '2013/2014',\n", " 2014: '2014/2015',\n", " 2015: '2015/2016',\n", " 2016: '2016/2017',\n", " 2017: '2017/2018',\n", " 2018: '2018/2019',\n", " 2019: '2019/2020',\n", " 2020: '2020/2021',\n", " 2021: '2021/2022',\n", " 2022: '2022/2023',\n", " 2023: '2023/2024',\n", " }" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Defined Lists" ] }, { "cell_type": "code", "execution_count": 104, "metadata": {}, "outputs": [], "source": [ "# Defined Lists\n", "\n", "## Define list of folders\n", "lst_folders = ['raw', 'engineered']\n", "\n", "\n", "## Define list of data types\n", "lst_data_types = ['ratings_by_date', 'ratings_by_team']\n", "\n", "\n", "## Define lists of Teams and Countries\n", "df_elo_teams_leagues = pd.read_csv(data_dir + '/reference/teams/elo_team_leagues_latest.csv')\n", "\n", "### Countries\n", "lst_countries = list(df_elo_teams_leagues['Country'].unique())\n", "\n", "### 'Big 5' European League Countries\n", "lst_countries_big5 = ['ENG', 'ESP', 'FRA', 'GER', 'ITA']\n", "\n", "### Teams \n", "lst_teams = list(df_elo_teams_leagues['Club'].unique())" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Custom Functions" ] }, { "cell_type": "code", "execution_count": 24, "metadata": {}, "outputs": [], "source": [ "# Define retry requests session function - taken from: https://www.peterbe.com/plog/best-practice-with-retries-with-requests\n", "def requests_retry_session(\n", " retries=3,\n", " backoff_factor=0.3,\n", " status_forcelist=(500, 502, 504),\n", " session=None,\n", "):\n", " session = session or requests.Session()\n", " retry = Retry(\n", " total=retries,\n", " read=retries,\n", " connect=retries,\n", " backoff_factor=backoff_factor,\n", " status_forcelist=status_forcelist,\n", " )\n", " adapter = HTTPAdapter(max_retries=retry)\n", " session.mount('http://', adapter)\n", " session.mount('https://', adapter)\n", " return session" ] }, { "cell_type": "code", "execution_count": 57, "metadata": {}, "outputs": [], "source": [ "# Define function for scraping the Elo rating, team-by-team\n", "def get_elo_team_ratings():\n", " \n", " \"\"\"\n", " Function to scrape the Elo ratings of teams, team-by-team.\n", " \"\"\" \n", " \n", " ## Start timer\n", " tic = datetime.datetime.now()\n", " \n", " \n", " ## Print time scraping started\n", " print(f'Scraping started at: {tic}')\n", " \n", " ## Define list of countries\n", " lst_countries =list(df_elo_teams_leagues['Country'].unique())\n", " \n", " ## Loop through countries\n", " for country in lst_countries:\n", " \n", " ### Print statement\n", " print(f'Scraping started for Team Elo data for {country}...')\n", " \n", " df_temp = df_elo_teams_leagues[df_elo_teams_leagues['Country']==country]\n", " lst_teams = list(df_temp['Club'].unique())\n", " \n", " ### Loop through teams\n", " for team in lst_teams:\n", " \n", " #### Define team name used when saving to folder (Snailcase)\n", " team_folder = team.replace(' ', '_')\n", " \n", " #### Define team name for use with URL (lowercase, no spaces)\n", " team_stripped = team.lower().strip().replace(' ', '')\n", " \n", " #### Save Player URL List (if not already saved)\n", " if not os.path.exists(os.path.join(data_dir_elo + f'/raw/ratings_by_team/{country}/{team_folder}_{country}_elo_rating_latest.csv')):\n", "\n", " ##### Scraping\n", "\n", " ###### Print statement\n", " print(f'Scraping started for Team Elo data {team} in {country}...')\n", "\n", " ###### Define URL\n", " url = f'http://api.clubelo.com/{team_stripped}'\n", "\n", " ###### Call requests_retry_session function, defined in previous command\n", " response = requests_retry_session().get(url)\n", " #print(response.status_code)\n", "\n", " ###### \n", " s = requests.Session()\n", " s.auth = ('user', 'pass')\n", " s.headers.update({'x-test': 'true'})\n", "\n", " ##### \n", " response = requests_retry_session(session=s).get(url)\n", "\n", " ###### \n", " data = StringIO(response .text)\n", " df = pd.read_csv(data, sep=',')\n", "\n", " \n", " ###### Data Engineering\n", " \n", " ####### Convert 'From' and 'To' to datatime \n", " df['From'] = pd.to_datetime(df['From'])\n", " df['To'] = pd.to_datetime(df['To'])\n", "\n", " ####### Drop duplicate rows\n", " df = df.drop_duplicates()\n", "\n", " \n", " ##### Save DataFrame\n", " \n", " ###### Save latest version\n", " df.to_csv(data_dir_elo + f'/raw/ratings_by_team/{country}/{team_folder}_{country}_elo_rating_latest.csv', index=None, header=True) \n", "\n", " ###### Export a copy to the 'archive' subfolder, including the date\n", " df.to_csv(data_dir_elo + f'/raw/ratings_by_team/{country}/archive/{team_folder}_{country}_elo_rating_last_updated_{today}.csv', index=None, header=True) \n", "\n", " \n", " ##### Print statement for team\n", " print(f'Team Elo rating data for {team} scraped and saved.')\n", "\n", "\n", " ##### If Team Elo rating already saved\n", " else:\n", "\n", " ###### Print statement\n", " print(f'Team Elo rating data for {team} already saved as a CSV file.') \n", "\n", " \n", " ## End timer\n", " toc = datetime.datetime.now()\n", " \n", " \n", " ## Print time scraping ended\n", " print(f'Scraping ended at: {toc}')\n", "\n", " \n", " ## Calculate time take\n", " total_time = (toc-tic).total_seconds()\n", " print(f'Time taken to scrape the Team Elo for {len(teams)} teams in {len(countries)} countries is: {total_time/60:0.2f} minutes.')\n", "\n", " \n", " ## Unify individual CSV files as a single DataFrame\n", " \n", " ### Show files in directory\n", " all_files = glob.glob(os.path.join(data_dir_elo + f'/raw/ratings_by_team/*/*_elo_rating_latest.csv'))\n", " \n", " ### Create an empty list of Players URLs\n", " lst_team_elo_ratings_all = []\n", "\n", " ### Loop through list of files and read into temporary DataFrames\n", " for filename in all_files:\n", " df_temp = pd.read_csv(filename, index_col=None, header=0)\n", " lst_team_elo_ratings_all.append(df_temp)\n", "\n", " ### Concatenate the files into a single DataFrame\n", " df_elo_teams_all = pd.concat(lst_team_elo_ratings_all, axis=0, ignore_index=True)\n", " \n", " ### Reset index\n", " df_elo_teams_all = df_elo_teams_all.reset_index(drop=True)\n", " \n", " ### Sort DataFrame\n", " df_elo_teams_all = df_elo_teams_all.sort_values(['Country', 'Club', 'To'], ascending=[True, True, True])\n", "\n", " \n", " ## Export DataFrame\n", " \n", " ### Save latest version\n", " df_elo_teams_all.to_csv(data_dir_elo + f'/raw/ratings_by_team/elo_team_ratings_combined_latest.csv', index=None, header=True)\n", " \n", " ### Save a copy to archive folder (dated)\n", " df_elo_teams_all.to_csv(data_dir_elo + f'/raw/ratings_by_team/archive/elo_team_ratings_combined_last_updated_{today}.csv', index=None, header=True)\n", " \n", " \n", " ## Distinct number of clubs and countries\n", " total_countries = df_elo_teams_all['Country'].nunique()\n", " total_clubs = df_elo_teams_all['Club'].nunique()\n", "\n", "\n", " ## Print statement\n", " print(f'Combined Elo DataFrame contains {total_countries} countries and {total_clubs} clubs.')\n", " \n", " \n", " ## Return final list of Player URLs\n", " return(df_elo_teams_all)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Create Directory Structure\n", "Create folders and subfolders for data, if not already created." ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [], "source": [ "# Make the data directory structure\n", "for folder in lst_folders:\n", " path = os.path.join(data_dir_elo, folder)\n", " if not os.path.exists(path):\n", " os.mkdir(path)\n", " for data_types in lst_data_types:\n", " path = os.path.join(data_dir_elo, folder, data_types)\n", " if not os.path.exists(path):\n", " os.mkdir(path)\n", " for country in lst_countries:\n", " path = os.path.join(data_dir_elo, folder, data_types, country)\n", " if not os.path.exists(path):\n", " os.mkdir(path)\n", " os.mkdir(os.path.join(path, 'archive'))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Notebook Settings" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [], "source": [ "# Display all columns of pandas DataFrames\n", "pd.set_option('display.max_columns', None)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "---\n", "\n", "\n", "\n", "## 2. Project Brief\n", "This Jupyter notebook is part of a series of notebooks to scrape, parse, engineer, unify, and the model, culminating in a an Expected Transfer (xTransfer) player performance vs. valuation model. This model aims to determine the under- and over-performing players based on their on-the-pitch output against transfer fee and wages.\n", "\n", "This particular notebook is one of several data parsing notebooks, that cleans team rating data from [Club ELO](http://clubelo.com/) using [pandas](http://pandas.pydata.org/).\n", "\n", "This notebook, along with the other notebooks in this project workflow are shown in the following diagram:\n", "\n", "![roadmap](../../img/football_analytics_data_roadmap.png)\n", "\n", "Links to these notebooks in the [`football_analytics`](https://github.com/eddwebster/football_analytics) GitHub repository can be found at the following:\n", "* [Webscraping](https://github.com/eddwebster/football_analytics/tree/master/notebooks/1_data_scraping)\n", " + [FBref Player Stats Webscraping](https://github.com/eddwebster/football_analytics/blob/master/notebooks/1_data_scraping/FBref%20Player%20Stats%20Web%20Scraping.ipynb)\n", " + [TransferMarket Player Bio and Status Webscraping](https://github.com/eddwebster/football_analytics/blob/master/notebooks/1_data_scraping/TransferMarkt%20Player%20Bio%20and%20Status%20Web%20Scraping.ipynb)\n", " + [TransferMarket Player Valuation Webscraping](https://github.com/eddwebster/football_analytics/blob/master/notebooks/1_data_scraping/TransferMarkt%20Player%20Valuation%20Web%20Scraping.ipynb)\n", " + [TransferMarkt Player Recorded Transfer Fees Webscraping](https://github.com/eddwebster/football_analytics/blob/master/notebooks/1_data_scraping/TransferMarkt%20Player%20Recorded%20Transfer%20Fees%20Webscraping.ipynb)\n", " + [Capology Player Salary Webscraping](https://github.com/eddwebster/football_analytics/blob/master/notebooks/1_data_scraping/Capology%20Player%20Salary%20Web%20Scraping.ipynb)\n", " + [FBref Team Stats Webscraping](https://github.com/eddwebster/football_analytics/blob/master/notebooks/1_data_scraping/FBref%20Team%20Stats%20Web%20Scraping.ipynb)\n", "* [Data Parsing](https://github.com/eddwebster/football_analytics/tree/master/notebooks/2_data_parsing)\n", " + [ELO Team Ratings Data Parsing](https://github.com/eddwebster/football_analytics/blob/master/notebooks/2_data_parsing/ELO%20Team%20Ratings%20Data%20Parsing.ipynb)\n", "* [Data Engineering](https://github.com/eddwebster/football_analytics/tree/master/notebooks/3_data_engineering)\n", " + [FBref Player Stats Data Engineering](https://github.com/eddwebster/football_analytics/blob/master/notebooks/3_data_engineering/FBref%20Player%20Stats%20Data%20Engineering.ipynb)\n", " + [TransferMarket Player Bio and Status Data Engineering](https://github.com/eddwebster/football_analytics/blob/master/notebooks/3_data_engineering/TransferMarkt%20Player%20Bio%20and%20Status%20Data%20Engineering.ipynb)\n", " + [TransferMarket Player Valuation Data Engineering](https://github.com/eddwebster/football_analytics/blob/master/notebooks/3_data_engineering/TransferMarkt%20Player%20Valuation%20Data%20Engineering.ipynb)\n", " + [TransferMarkt Player Recorded Transfer Fees Data Engineering](https://github.com/eddwebster/football_analytics/blob/master/notebooks/3_data_engineering/TransferMarkt%20Player%20Recorded%20Transfer%20Fees%20Data%20Engineering.ipynb)\n", " + [Capology Player Salary Data Engineering](https://github.com/eddwebster/football_analytics/blob/master/notebooks/3_data_engineering/Capology%20Player%20Salary%20Data%20Engineering.ipynb)\n", " + [FBref Team Stats Data Engineering](https://github.com/eddwebster/football_analytics/blob/master/notebooks/3_data_engineering/FBref%20Team%20Stats%20Data%20Engineering.ipynb)\n", " + [ELO Team Ratings Data Parsing](https://github.com/eddwebster/football_analytics/blob/master/notebooks/3_data_engineering/ELO%20Team%20Ratings%20Data%20Parsing.ipynb)\n", " + [TransferMarkt Team Recorded Transfer Fee Data Engineering](https://github.com/eddwebster/football_analytics/blob/master/notebooks/3_data_engineering/TransferMarkt%20Team%20Recorded%20Transfer%20Fee%20Data%20Engineering.ipynb) (aggregated from [TransferMarkt Player Recorded Transfer Fees notebook](https://github.com/eddwebster/football_analytics/blob/master/notebooks/3_data_engineering/TransferMarkt%20Player%20Recorded%20Transfer%20Fees%20Data%20Engineering.ipynb))\n", " + [Capology Team Salary Data Engineering](https://github.com/eddwebster/football_analytics/blob/master/notebooks/3_data_engineering/Capology%20Team%20Salary%20Data%20Engineering.ipynb) (aggregated from [Capology Player Salary notebook](https://github.com/eddwebster/football_analytics/blob/master/notebooks/3_data_engineering/Capology%20Player%20Salary%20Data%20Engineering.ipynb))\n", "* [Data Unification](https://github.com/eddwebster/football_analytics/tree/master/notebooks/4_data_unification)\n", " + [Golden ID for Player Level Datasets](https://github.com/eddwebster/football_analytics/blob/master/notebooks/4_data_unification/Golden%20ID%20for%20Player%20Level%20Datasets.ipynb)\n", " + [Golden ID for Team Level Datasets](https://github.com/eddwebster/football_analytics/blob/master/notebooks/4_data_unification/Golden%20ID%20for%20Team%20Level%20Datasets.ipynb)\n", "* [Production Datasets](https://github.com/eddwebster/football_analytics/tree/master/notebooks/5_production_datasets)\n", " + [Player Performance/Market Value Dataset](https://github.com/eddwebster/football_analytics/tree/master/notebooks/5_production_datasets/Player%20Performance/Market%20Value%20Dataset.ipynb)\n", " + [Team Performance/Market Value Dataset](https://github.com/eddwebster/football_analytics/tree/master/notebooks/5_production_datasets/Team%20Performance/Market%20Value%20Dataset.ipynb)\n", "* [Expected Transfer (xTransfer) Modeling](https://github.com/eddwebster/football_analytics/tree/master/notebooks/6_data_analysis_and_projects/expected_transfer_modeling)\n", " + [Expected Transfer (xTransfer) Modeling](https://github.com/eddwebster/football_analytics/tree/master/notebooks/6_data_analysis_and_projects/expected_transfer_modeling/Expected%20Transfer%20%20Modeling.ipynb)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "---\n", "\n", "\n", "\n", "## 3. Data Sources\n", "\n", "Before conducting our EDA, the data needs to be imported as a DataFrame in the Data Sources section [Section 3](#section3) and cleaned in the Data Engineering section [Section 4](#section4).\n", "\n", "We'll be using the [pandas](http://pandas.pydata.org/) library to import our data to this workbook as a DataFrame." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "### 3.1. Data Dictionaries\n", "The [Club ELO](http://clubelo.com/) dataset has eight features (columns) with the following definitions and data types:\n", "\n", "| Feature | Data type |\n", "|------|-----|\n", "| `Rank` | object |\n", "| `Club` | object |\n", "| `Country` | object |\n", "| `Level` | object |\n", "| `Elo` | object |\n", "| `From` | object |\n", "| `To` | object |" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "### 3.2. Scrape the Data\n", "See the [Club ELO](http://clubelo.com/) API [[link](http://clubelo.com/API)].\n", "\n", "Potential methodology to approach this problem\n", "- Day-by-day rankings seems to be not loading well, but teams are. Day-by-day rankings also only includes team rankings that are in the top 1/2 leagues, per competition. An example is Sheffield Wednesday that does not make the cut in 2021.\n", "- Download the day-by-day rankings once or twice per season, for the last x season. Use this to get all the unique team names.\n", "- From the unique team names gathered in the previous step, created a DataFrame of unique team names. From this DataFrame, create a list to loop through and download all their individual rankings. Expecting the final DataFrame to have at least 3.5M rows, if not more for lower-league English teams\n", "- In the same method as the TM Transfer History script, find a way to aggregate the rankings to an annual value, per team, per season." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "#### 3.2.1. Read in Data of Elo Rankings by Date\n", "- Data downloaded from: api.clubelo.com/YYYY-MM-DD .\n", "- Data downloads very slow and was done manually.\n", "- Following dataset will be used to determine a DataFrame of unique teams and their leagues. The data itself is not required." ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The Team ELO Rating by Date DataFrame contains 1,497 teams.\n" ] } ], "source": [ "## Unify individual CSV files as a single DataFrame\n", "\n", "### Show files in directory\n", "all_files = glob.glob(os.path.join(data_dir_elo + '/raw/ratings_by_date/*/*.csv'))\n", "\n", "### Create an empty list of Players URLs\n", "lst_team_elo_rating_all = []\n", "\n", "### Loop through list of files and read into temporary DataFrames\n", "for filename in all_files:\n", " df_temp = pd.read_csv(filename, index_col=None, header=0)\n", " lst_team_elo_rating_all.append(df_temp)\n", "\n", "### Concatenate the files into a single DataFrame\n", "df_elo_team_ratings_all = pd.concat(lst_team_elo_rating_all, axis=0, ignore_index=True)\n", "\n", "\n", "## Reset index\n", "df_elo_team_ratings_all = df_elo_team_ratings_all.reset_index(drop=True)\n", "\n", "\n", "## Sort DataFrame\n", "df_elo_team_ratings_all = df_elo_team_ratings_all.sort_values(['Country', 'Club'], ascending=[True, True])\n", "\n", "\n", "## Export DataFrame\n", "\n", "### Save latest version\n", "df_elo_team_ratings_all.to_csv(data_dir_elo + '/raw/ratings_by_date/elo_team_rating_by_date_combined_latest.csv', index=None, header=True)\n", "\n", "### Save a copy to archive folder (dated)\n", "df_elo_team_ratings_all.to_csv(data_dir_elo + f'/raw/ratings_by_date/archive/elo_team_rating_by_date_combined_last_updated_{today}.csv', index=None, header=True)\n", "\n", "\n", "## Distinct number of players\n", "total_teams = df_elo_team_ratings_all['Club'].nunique()\n", "\n", "\n", "## Print statement\n", "print(f'The Team ELO Rating by Date DataFrame contains {total_teams:,} teams.')" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
RankClubCountryLevelEloFromTo
5696NoneBesa KavajeALB01142.9272462007-08-312008-07-01
5697NoneBesa KavajeALB01137.8015142007-07-262007-08-02
5698NoneBesa KavajeALB01099.6958012010-07-232011-06-30
5699NoneBesa KavajeALB01099.6958012010-07-232011-06-30
5700NoneBesa KavajeALB01142.9272462007-08-312008-07-01
........................
133286NoneThe New SaintsWAL01088.2508542001-07-262001-08-01
133885NoneThe New SaintsWAL01064.5292972002-08-302003-07-16
134476NoneThe New SaintsWAL01068.1160892002-07-252002-08-15
135076NoneThe New SaintsWAL01055.7418212003-08-292004-07-14
135672NoneThe New SaintsWAL01056.6358642003-07-242003-08-14
\n", "

135700 rows × 7 columns

\n", "
" ], "text/plain": [ " Rank Club Country Level Elo From \\\n", "5696 None Besa Kavaje ALB 0 1142.927246 2007-08-31 \n", "5697 None Besa Kavaje ALB 0 1137.801514 2007-07-26 \n", "5698 None Besa Kavaje ALB 0 1099.695801 2010-07-23 \n", "5699 None Besa Kavaje ALB 0 1099.695801 2010-07-23 \n", "5700 None Besa Kavaje ALB 0 1142.927246 2007-08-31 \n", "... ... ... ... ... ... ... \n", "133286 None The New Saints WAL 0 1088.250854 2001-07-26 \n", "133885 None The New Saints WAL 0 1064.529297 2002-08-30 \n", "134476 None The New Saints WAL 0 1068.116089 2002-07-25 \n", "135076 None The New Saints WAL 0 1055.741821 2003-08-29 \n", "135672 None The New Saints WAL 0 1056.635864 2003-07-24 \n", "\n", " To \n", "5696 2008-07-01 \n", "5697 2007-08-02 \n", "5698 2011-06-30 \n", "5699 2011-06-30 \n", "5700 2008-07-01 \n", "... ... \n", "133286 2001-08-01 \n", "133885 2003-07-16 \n", "134476 2002-08-15 \n", "135076 2004-07-14 \n", "135672 2003-08-14 \n", "\n", "[135700 rows x 7 columns]" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_elo_team_ratings_all" ] }, { "cell_type": "code", "execution_count": 103, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
ClubCountry
0Besa KavajeALB
1Bylis BallshALB
2Dinamo TiranaALB
3ElbasaniALB
4FlamurtariALB
\n", "
" ], "text/plain": [ " Club Country\n", "0 Besa Kavaje ALB\n", "1 Bylis Ballsh ALB\n", "2 Dinamo Tirana ALB\n", "3 Elbasani ALB\n", "4 Flamurtari ALB" ] }, "execution_count": 103, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Create DataFrame of unique clubs and countries for reference\n", "\n", "## Define columns of interest\n", "lst_cols = ['Club', 'Country']\n", "\n", "## Select columns of interest\n", "df_elo_teams_leagues = df_elo_team_ratings_all[lst_cols]\n", "\n", "\n", "# Drop duplicates\n", "df_elo_teams_leagues = df_elo_teams_leagues.drop_duplicates()\n", "\n", "\n", "# Sort DataFrame by Country/Club\n", "df_elo_teams_leagues = df_elo_teams_leagues.sort_values(['Country', 'Club'], ascending=[True, True])\n", "\n", "\n", "# Reset index\n", "df_elo_teams_leagues = df_elo_teams_leagues.reset_index(drop=True)\n", "\n", "\n", "# Export DataFrame\n", "if not os.path.exists(os.path.join(data_dir + f'/reference/teams/archive/elo_team_leagues_last_updated_{today}.csv')):\n", " \n", " ### Save latest version\n", " df_elo_teams_leagues.to_csv(data_dir + '/reference/teams/elo_team_leagues_latest.csv', index=None, header=True)\n", "\n", " ### Save a copy to archive folder (dated)\n", " df_elo_teams_leagues.to_csv(data_dir + f'/reference/teams/archive/elo_team_leagues_last_updated_{today}.csv', index=None, header=True) \n", "\n", "else:\n", " df_elo_teams_leagues = pd.read_csv(data_dir + '/reference/teams/elo_team_leagues_latest.csv')\n", " print('Data already saved previously')\n", "\n", " \n", "# Display DataFrame\n", "df_elo_teams_leagues.head()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "df_elo_teams_leagues.shape" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "## All unique Teams\n", "lst_teams = list(df_elo_teams_leagues['Club_Trimmed'].unique())" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "1497" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(lst_teams)" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [], "source": [ "## All unique Countries\n", "lst_countries = list(df_elo_teams_leagues['Country'].unique())" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "56" ] }, "execution_count": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(lst_countries)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "#### 3.2.2. Scrape Data of Elo Rankings by Date\n", "Format of scraping data: 'api.clubelo.com/YYYY-MM-DD' e.g. https://api.clubelo.com/2021-09-02." ] }, { "cell_type": "code", "execution_count": 21, "metadata": {}, "outputs": [], "source": [ "# Create list of dates for the last number of defined years\n", "\n", "## Define today's date\n", "today = datetime.datetime.now().strftime('%d/%m/%Y').replace('/', '')\n", "\n", "## Create an empty list for scraped player bio data to be appended\n", "lst_dates = []\n", "\n", "## Define start and end date\n", "sdate = date(2016, 8, 1) # start date\n", "edate = date(2021, 9, 2) # end date ## CHANGE TO TODAY'S DATE\n", "\n", "## Determine the difference between the two dates\n", "delta = edate - sdate # as timedelta\n", "\n", "##\n", "for i in range(delta.days + 1):\n", " day = sdate + timedelta(days=i)\n", " day = day.strftime('%Y/%m/%d').replace('/', '')\n", " lst_dates.append(day)" ] }, { "cell_type": "code", "execution_count": 22, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "1859" ] }, "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(lst_dates)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "#### 3.2.3. Scrape Data of Elo Rankings by Team\n", "Data scraped for individual teams and then saved before being combined to a unified DataFrame, ready for Data Engineering, using the `get_elo_team_ratings()` defined in the **Custom Functions** section of the notebook. This function incorporates ClubElo's API [[link](http://clubelo.com/API)] which has a 'One club's rating history' feature, that provides the ranking history for an individual club, going back to the mid forties (note however that Club Elo states that values before 1960 should be considered provisional).\n", "\n", "The format for obtaining a team's ranking is: api.clubelo.com/CLUBNAME i.e. [api.clubelo.com/mancity](api.clubelo.com/mancity)." ] }, { "cell_type": "code", "execution_count": 168, "metadata": { "scrolled": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Scraping started at: 2021-09-04 18:21:20.001197\n", "Scraping started for Team Elo data for ALB...\n", "Team Elo rating data for Besa Kavaje already saved as a CSV file.\n", "Team Elo rating data for Bylis Ballsh already saved as a CSV file.\n", "Team Elo rating data for Dinamo Tirana already saved as a CSV file.\n", "Team Elo rating data for Elbasani already saved as a CSV file.\n", "Team Elo rating data for Flamurtari already saved as a CSV file.\n", "Team Elo rating data for Kukesi already saved as a CSV file.\n", "Team Elo rating data for Laci already saved as a CSV file.\n", "Team Elo rating data for Luftetari already saved as a CSV file.\n", "Team Elo rating data for Partizani Tirana already saved as a CSV file.\n", "Team Elo rating data for Skenderbeu already saved as a CSV file.\n", "Team Elo rating data for Teuta Durres already saved as a CSV file.\n", "Team Elo rating data for Tirana already saved as a CSV file.\n", "Team Elo rating data for Tomori Berat already saved as a CSV file.\n", "Team Elo rating data for Vllaznia already saved as a CSV file.\n", "Scraping started for Team Elo data for AND...\n", "Team Elo rating data for CE Principat already saved as a CSV file.\n", "Team Elo rating data for Constelacio Esportiva already saved as a CSV file.\n", "Team Elo rating data for Encamp already saved as a CSV file.\n", "Team Elo rating data for Engordany already saved as a CSV file.\n", "Team Elo rating data for Escaldes already saved as a CSV file.\n", "Team Elo rating data for Escale already saved as a CSV file.\n", "Team Elo rating data for FC Rangers already saved as a CSV file.\n", "Team Elo rating data for Lusitanos already saved as a CSV file.\n", "Team Elo rating data for Matecosa Sant Julia already saved as a CSV file.\n", "Team Elo rating data for Santa Coloma already saved as a CSV file.\n", "Scraping started for Team Elo data for ARM...\n", "Team Elo rating data for Alashkert already saved as a CSV file.\n", "Team Elo rating data for Ararat already saved as a CSV file.\n", "Team Elo rating data for Ararat-Armenia already saved as a CSV file.\n", "Team Elo rating data for Banants already saved as a CSV file.\n", "Team Elo rating data for FC Yerevan already saved as a CSV file.\n", "Team Elo rating data for Gandzasar Kapan already saved as a CSV file.\n", "Team Elo rating data for MIKA already saved as a CSV file.\n", "Team Elo rating data for Noah already saved as a CSV file.\n", "Team Elo rating data for Pyunik already saved as a CSV file.\n", "Team Elo rating data for Shirak already saved as a CSV file.\n", "Team Elo rating data for Spartak Yerevan already saved as a CSV file.\n", "Team Elo rating data for Ulisses already saved as a CSV file.\n", "Team Elo rating data for Zvartnots already saved as a CSV file.\n", "Scraping started for Team Elo data for AUT...\n", "Team Elo rating data for Admira already saved as a CSV file.\n", "Team Elo rating data for Altach already saved as a CSV file.\n", "Team Elo rating data for Austria Kaernten already saved as a CSV file.\n", "Team Elo rating data for Austria Wien already saved as a CSV file.\n", "Team Elo rating data for Bregenz already saved as a CSV file.\n", "Team Elo rating data for FCK Kaernten already saved as a CSV file.\n", "Team Elo rating data for GAK already saved as a CSV file.\n", "Team Elo rating data for Groedig already saved as a CSV file.\n", "Team Elo rating data for Hartberg already saved as a CSV file.\n", "Team Elo rating data for Kapfenberg already saved as a CSV file.\n", "Team Elo rating data for Klagenfurt already saved as a CSV file.\n", "Team Elo rating data for LASK already saved as a CSV file.\n", "Team Elo rating data for Lustenau already saved as a CSV file.\n", "Team Elo rating data for Mattersburg already saved as a CSV file.\n", "Team Elo rating data for Pasching already saved as a CSV file.\n", "Team Elo rating data for Rapid Wien already saved as a CSV file.\n", "Team Elo rating data for Ried already saved as a CSV file.\n", "Team Elo rating data for Salzburg already saved as a CSV file.\n", "Team Elo rating data for St Poelten already saved as a CSV file.\n", "Team Elo rating data for Sturm Graz already saved as a CSV file.\n", "Team Elo rating data for Wacker Innsbruck already saved as a CSV file.\n", "Team Elo rating data for Wattens already saved as a CSV file.\n", "Team Elo rating data for Wiener Neustadt already saved as a CSV file.\n", "Team Elo rating data for Wolfsberg already saved as a CSV file.\n", "Scraping started for Team Elo data for AZE...\n", "Team Elo rating data for AZAL Baku already saved as a CSV file.\n", "Team Elo rating data for FK Baku already saved as a CSV file.\n", "Team Elo rating data for FK Karvan Evlakh already saved as a CSV file.\n", "Team Elo rating data for Gabala already saved as a CSV file.\n", "Team Elo rating data for Inter Baku already saved as a CSV file.\n", "Team Elo rating data for Kapaz Ganca already saved as a CSV file.\n", "Team Elo rating data for Karabakh Agdam already saved as a CSV file.\n", "Team Elo rating data for Khazar already saved as a CSV file.\n", "Team Elo rating data for MKT Araz Imishli already saved as a CSV file.\n", "Team Elo rating data for Neftchi already saved as a CSV file.\n", "Team Elo rating data for Sabail already saved as a CSV file.\n", "Team Elo rating data for Shafa already saved as a CSV file.\n", "Team Elo rating data for Shamkir already saved as a CSV file.\n", "Team Elo rating data for Simurq Zaqatala already saved as a CSV file.\n", "Team Elo rating data for Sumqayit already saved as a CSV file.\n", "Team Elo rating data for Zira already saved as a CSV file.\n", "Scraping started for Team Elo data for BEL...\n", "Team Elo rating data for Aalst already saved as a CSV file.\n", "Team Elo rating data for Anderlecht already saved as a CSV file.\n", "Team Elo rating data for Antwerp already saved as a CSV file.\n", "Team Elo rating data for Beerschot AC already saved as a CSV file.\n", "Team Elo rating data for Bergen already saved as a CSV file.\n", "Team Elo rating data for Beveren already saved as a CSV file.\n", "Team Elo rating data for Brugge already saved as a CSV file.\n", "Team Elo rating data for Cercle Brugge already saved as a CSV file.\n", "Team Elo rating data for Charleroi already saved as a CSV file.\n", "Team Elo rating data for Dender already saved as a CSV file.\n", "Team Elo rating data for Eupen already saved as a CSV file.\n", "Team Elo rating data for FC Brussels already saved as a CSV file.\n", "Team Elo rating data for Geel already saved as a CSV file.\n", "Team Elo rating data for Genk already saved as a CSV file.\n", "Team Elo rating data for Gent already saved as a CSV file.\n", "Team Elo rating data for Harelbeke already saved as a CSV file.\n", "Team Elo rating data for Heusden Zolder already saved as a CSV file.\n", "Team Elo rating data for Kortrijk already saved as a CSV file.\n", "Team Elo rating data for Leuven already saved as a CSV file.\n", "Team Elo rating data for Lierse already saved as a CSV file.\n", "Team Elo rating data for Lokeren already saved as a CSV file.\n", "Team Elo rating data for Lommel already saved as a CSV file.\n", "Team Elo rating data for Louvieroise already saved as a CSV file.\n", "Team Elo rating data for Mechelen already saved as a CSV file.\n", "Team Elo rating data for Molenbeek already saved as a CSV file.\n", "Team Elo rating data for Mouscron already saved as a CSV file.\n", "Team Elo rating data for Oostende already saved as a CSV file.\n", "Team Elo rating data for Roeselare already saved as a CSV file.\n", "Team Elo rating data for Seraing already saved as a CSV file.\n", "Team Elo rating data for St Gillis already saved as a CSV file.\n", "Team Elo rating data for St Truiden already saved as a CSV file.\n", "Team Elo rating data for Standard already saved as a CSV file.\n", "Team Elo rating data for Tubize already saved as a CSV file.\n", "Team Elo rating data for Westerlo already saved as a CSV file.\n", "Team Elo rating data for Zulte Waregem already saved as a CSV file.\n", "Scraping started for Team Elo data for BHZ...\n", "Team Elo rating data for Borac Banja Luka already saved as a CSV file.\n", "Team Elo rating data for Brotnjo Citluk already saved as a CSV file.\n", "Team Elo rating data for Buduchnost Banovici already saved as a CSV file.\n", "Team Elo rating data for FK Sarajevo already saved as a CSV file.\n", "Team Elo rating data for Leotar Trebinje already saved as a CSV file.\n", "Team Elo rating data for Modrica Maksima already saved as a CSV file.\n", "Team Elo rating data for Olimpik Sarajevo already saved as a CSV file.\n", "Team Elo rating data for Orasje already saved as a CSV file.\n", "Team Elo rating data for Radnik Bijeljina already saved as a CSV file.\n", "Team Elo rating data for Siroki Brijeg already saved as a CSV file.\n", "Team Elo rating data for Slavija Istocno already saved as a CSV file.\n", "Team Elo rating data for Sloboda Tuzla already saved as a CSV file.\n", "Team Elo rating data for Velez Mostar already saved as a CSV file.\n", "Team Elo rating data for Zeljeznicar already saved as a CSV file.\n", "Team Elo rating data for Zepce Limorad already saved as a CSV file.\n", "Team Elo rating data for Zrinjski Mostar already saved as a CSV file.\n", "Scraping started for Team Elo data for BLR...\n", "Team Elo rating data for BATE already saved as a CSV file.\n", "Team Elo rating data for Bobruisk already saved as a CSV file.\n", "Team Elo rating data for Darida already saved as a CSV file.\n", "Team Elo rating data for Dinamo Brest already saved as a CSV file.\n", "Team Elo rating data for Dinamo Minsk already saved as a CSV file.\n", "Team Elo rating data for Dnepr Mogilev already saved as a CSV file.\n", "Team Elo rating data for FK Minsk already saved as a CSV file.\n", "Team Elo rating data for FK Vitebsk already saved as a CSV file.\n", "Team Elo rating data for Gomel already saved as a CSV file.\n", "Team Elo rating data for Gorodeya already saved as a CSV file.\n", "Team Elo rating data for Granit Mikashevichy already saved as a CSV file.\n", "Team Elo rating data for Isloch already saved as a CSV file.\n", "Team Elo rating data for Kamunalnik already saved as a CSV file.\n", "Team Elo rating data for Krumkachy already saved as a CSV file.\n", "Team Elo rating data for Lida already saved as a CSV file.\n", "Team Elo rating data for Lok Minsk already saved as a CSV file.\n", "Team Elo rating data for Luch Minsk already saved as a CSV file.\n", "Team Elo rating data for MTZ-RIPO already saved as a CSV file.\n", "Team Elo rating data for Maladzyechna already saved as a CSV file.\n", "Team Elo rating data for Neman Grodno already saved as a CSV file.\n", "Team Elo rating data for Novopolotsk already saved as a CSV file.\n", "Team Elo rating data for Rukh Brest already saved as a CSV file.\n", "Team Elo rating data for Savit already saved as a CSV file.\n", "Team Elo rating data for Slavia Mozyr already saved as a CSV file.\n", "Team Elo rating data for Slutsk already saved as a CSV file.\n", "Team Elo rating data for Smolevichi already saved as a CSV file.\n", "Team Elo rating data for Smorgon already saved as a CSV file.\n", "Team Elo rating data for Soligorsk already saved as a CSV file.\n", "Team Elo rating data for Sputnik already saved as a CSV file.\n", "Team Elo rating data for Svisloch-Krovlya already saved as a CSV file.\n", "Team Elo rating data for Torpedo Minsk already saved as a CSV file.\n", "Team Elo rating data for Torpedo Mogilev already saved as a CSV file.\n", "Team Elo rating data for Torpedo Zhodino already saved as a CSV file.\n", "Team Elo rating data for Vedrych already saved as a CSV file.\n", "Team Elo rating data for Zvyazda BDU already saved as a CSV file.\n", "Scraping started for Team Elo data for BUL...\n", "Team Elo rating data for Akademik Sofia already saved as a CSV file.\n", "Team Elo rating data for Arda already saved as a CSV file.\n", "Team Elo rating data for Belasitsa Petrich already saved as a CSV file.\n", "Team Elo rating data for Beroe Stara Zagora already saved as a CSV file.\n", "Team Elo rating data for Blagoevgrad already saved as a CSV file.\n", "Team Elo rating data for Botev Plovdiv already saved as a CSV file.\n", "Team Elo rating data for Botev Vratsa already saved as a CSV file.\n", "Team Elo rating data for CSKA 1948 Sofia already saved as a CSV file.\n", "Team Elo rating data for CSKA Sofia already saved as a CSV file.\n", "Team Elo rating data for Cherno More already saved as a CSV file.\n", "Team Elo rating data for Chernomorets Burgas already saved as a CSV file.\n", "Team Elo rating data for Dobrudzha already saved as a CSV file.\n", "Team Elo rating data for Dunav Ruse already saved as a CSV file.\n", "Team Elo rating data for Etar already saved as a CSV file.\n", "Team Elo rating data for Gotse Delchev already saved as a CSV file.\n", "Team Elo rating data for Haskovo already saved as a CSV file.\n", "Team Elo rating data for Hebar already saved as a CSV file.\n", "Team Elo rating data for Kaliakra Kavarna already saved as a CSV file.\n", "Team Elo rating data for Levski already saved as a CSV file.\n", "Team Elo rating data for Litex already saved as a CSV file.\n", "Team Elo rating data for Lok Gorna already saved as a CSV file.\n", "Team Elo rating data for Lok Plovdiv already saved as a CSV file.\n", "Team Elo rating data for Lok Sofia already saved as a CSV file.\n", "Team Elo rating data for Lyubimets already saved as a CSV file.\n", "Team Elo rating data for Marek Dupnitza already saved as a CSV file.\n", "Team Elo rating data for Mezdra already saved as a CSV file.\n", "Team Elo rating data for Minyor Pernik already saved as a CSV file.\n", "Team Elo rating data for Montana 1921 already saved as a CSV file.\n", "Team Elo rating data for N Burgas already saved as a CSV file.\n", "Team Elo rating data for Nesebar already saved as a CSV file.\n", "Team Elo rating data for Pirin 1922 already saved as a CSV file.\n", "Team Elo rating data for Razgrad already saved as a CSV file.\n", "Team Elo rating data for Rodopa Smolian already saved as a CSV file.\n", "Team Elo rating data for Samakov already saved as a CSV file.\n", "Team Elo rating data for Septemvri Sofia already saved as a CSV file.\n", "Team Elo rating data for Sevlievo already saved as a CSV file.\n", "Team Elo rating data for Shumen already saved as a CSV file.\n", "Team Elo rating data for Slavia Sofia already saved as a CSV file.\n", "Team Elo rating data for Sliven already saved as a CSV file.\n", "Team Elo rating data for Spartak Pleven already saved as a CSV file.\n", "Team Elo rating data for Spartak Varna already saved as a CSV file.\n", "Team Elo rating data for Svetkavitsa already saved as a CSV file.\n", "Team Elo rating data for Svoge already saved as a CSV file.\n", "Team Elo rating data for Tsarsko Selo already saved as a CSV file.\n", "Team Elo rating data for Velbazhd already saved as a CSV file.\n", "Team Elo rating data for Vereya already saved as a CSV file.\n", "Team Elo rating data for Vihren Sandanski already saved as a CSV file.\n", "Team Elo rating data for Vitosha Bistritsa already saved as a CSV file.\n", "Scraping started for Team Elo data for CRO...\n", "Team Elo rating data for Cakovec already saved as a CSV file.\n", "Team Elo rating data for Cibalia Vinkovci already saved as a CSV file.\n", "Team Elo rating data for Croatia Sesvete already saved as a CSV file.\n", "Team Elo rating data for Dinamo Zagreb already saved as a CSV file.\n", "Team Elo rating data for Dragovoljac already saved as a CSV file.\n", "Team Elo rating data for HNK Gorica already saved as a CSV file.\n", "Team Elo rating data for Hajduk already saved as a CSV file.\n", "Team Elo rating data for Inter Zapresic already saved as a CSV file.\n", "Team Elo rating data for Istra already saved as a CSV file.\n", "Team Elo rating data for Istra 1961 already saved as a CSV file.\n", "Team Elo rating data for Kamen Ingrad already saved as a CSV file.\n", "Team Elo rating data for Karlovac already saved as a CSV file.\n", "Team Elo rating data for Lok Zagreb already saved as a CSV file.\n", "Team Elo rating data for Lucko already saved as a CSV file.\n", "Team Elo rating data for Marsonia already saved as a CSV file.\n", "Team Elo rating data for Medjimurje already saved as a CSV file.\n", "Team Elo rating data for NK Zagreb already saved as a CSV file.\n", "Team Elo rating data for Osijek already saved as a CSV file.\n", "Team Elo rating data for Pomorac already saved as a CSV file.\n", "Team Elo rating data for Rijeka already saved as a CSV file.\n", "Team Elo rating data for Rudes Zagreb already saved as a CSV file.\n", "Team Elo rating data for Sibenik already saved as a CSV file.\n", "Team Elo rating data for Slaven Belupo already saved as a CSV file.\n", "Team Elo rating data for Split 1912 already saved as a CSV file.\n", "Team Elo rating data for Topolovac already saved as a CSV file.\n", "Team Elo rating data for Varazdin already saved as a CSV file.\n", "Team Elo rating data for Varteks already saved as a CSV file.\n", "Team Elo rating data for Vukovar 91 already saved as a CSV file.\n", "Team Elo rating data for Zadar already saved as a CSV file.\n", "Scraping started for Team Elo data for CSR...\n", "Scraping started for Team Elo data Artmedia in CSR...\n" ] }, { "ename": "FileNotFoundError", "evalue": "[Errno 2] No such file or directory: '../../data/elo/raw/ratings_by_team/CSR/Artmedia_CSR_elo_rating_latest.csv'", "output_type": "error", "traceback": [ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31mFileNotFoundError\u001b[0m Traceback (most recent call last)", "\u001b[0;32m/var/folders/d7/wvbp_b411h75p3zvbmrvql080000gn/T/ipykernel_81883/3656556382.py\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mdf_elo_team_ratings_all_raw\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mget_elo_team_ratings\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", "\u001b[0;32m/var/folders/d7/wvbp_b411h75p3zvbmrvql080000gn/T/ipykernel_81883/2911065457.py\u001b[0m in \u001b[0;36mget_elo_team_ratings\u001b[0;34m()\u001b[0m\n\u001b[1;32m 75\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 76\u001b[0m \u001b[0;31m###### Save latest version\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 77\u001b[0;31m \u001b[0mdf\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mto_csv\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdata_dir_elo\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0;34mf'/raw/ratings_by_team/{country}/{team_folder}_{country}_elo_rating_latest.csv'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mindex\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mheader\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mTrue\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 78\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 79\u001b[0m \u001b[0;31m###### Export a copy to the 'archive' subfolder, including the date\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/opt/anaconda3/lib/python3.7/site-packages/pandas/core/generic.py\u001b[0m in \u001b[0;36mto_csv\u001b[0;34m(self, path_or_buf, sep, na_rep, float_format, columns, header, index, index_label, mode, encoding, compression, quoting, quotechar, line_terminator, chunksize, date_format, doublequote, escapechar, decimal, errors, storage_options)\u001b[0m\n\u001b[1;32m 3480\u001b[0m \u001b[0mdoublequote\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mdoublequote\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3481\u001b[0m \u001b[0mescapechar\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mescapechar\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 3482\u001b[0;31m \u001b[0mstorage_options\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mstorage_options\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 3483\u001b[0m )\n\u001b[1;32m 3484\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/opt/anaconda3/lib/python3.7/site-packages/pandas/io/formats/format.py\u001b[0m in \u001b[0;36mto_csv\u001b[0;34m(self, path_or_buf, encoding, sep, columns, index_label, mode, compression, quoting, quotechar, line_terminator, chunksize, date_format, doublequote, escapechar, errors, storage_options)\u001b[0m\n\u001b[1;32m 1103\u001b[0m \u001b[0mformatter\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfmt\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1104\u001b[0m )\n\u001b[0;32m-> 1105\u001b[0;31m \u001b[0mcsv_formatter\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msave\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1106\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1107\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mcreated_buffer\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/opt/anaconda3/lib/python3.7/site-packages/pandas/io/formats/csvs.py\u001b[0m in \u001b[0;36msave\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 241\u001b[0m \u001b[0merrors\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0merrors\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 242\u001b[0m \u001b[0mcompression\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcompression\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 243\u001b[0;31m \u001b[0mstorage_options\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mstorage_options\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 244\u001b[0m ) as handles:\n\u001b[1;32m 245\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/opt/anaconda3/lib/python3.7/site-packages/pandas/io/common.py\u001b[0m in \u001b[0;36mget_handle\u001b[0;34m(path_or_buf, mode, encoding, compression, memory_map, is_text, errors, storage_options)\u001b[0m\n\u001b[1;32m 704\u001b[0m \u001b[0mencoding\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mioargs\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mencoding\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 705\u001b[0m \u001b[0merrors\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0merrors\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 706\u001b[0;31m \u001b[0mnewline\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m\"\"\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 707\u001b[0m )\n\u001b[1;32m 708\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: '../../data/elo/raw/ratings_by_team/CSR/Artmedia_CSR_elo_rating_latest.csv'" ] } ], "source": [ "df_elo_team_ratings_all_raw = get_elo_team_ratings()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "### 3.3. Preliminary Data Handling\n", "Let's quality of the dataset by looking first and last rows in pandas using the [head()](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.head.html) and [tail()](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.tail.html) methods." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "#### 3.3.1. Summary Report\n", "Initial step of the data handling and Exploratory Data Analysis (EDA) is to create a quick summary report of the dataset using [pandas Profiling Report](https://github.com/pandas-profiling/pandas-profiling)." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Summary of the data using pandas Profiling Report\n", "#pp.ProfileReport(df_elo_team_ratings_all_raw)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "#### 3.3.2. Further Inspection\n", "The following commands go into more bespoke summary of the dataset. Some of the commands include content covered in the [pandas Profiling](https://github.com/pandas-profiling/pandas-profiling) summary above, but using the standard [pandas](https://pandas.pydata.org/) functions and methods that most peoplem will be more familiar with.\n", "\n", "First check the quality of the dataset by looking first and last rows in pandas using the [head()](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.head.html) and [tail()](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.tail.html) methods." ] }, { "cell_type": "code", "execution_count": 62, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
RankClubCountryLevelEloFromTo
1203829NoneBesa KavajeALB01325.2612301972-07-011972-09-13
1203830NoneBesa KavajeALB01337.4685061972-09-141972-09-27
1203831NoneBesa KavajeALB01338.1463621972-09-281972-10-25
1203832NoneBesa KavajeALB01335.0073241972-10-261972-11-08
1203833NoneBesa KavajeALB01334.8455811972-11-091978-07-01
\n", "
" ], "text/plain": [ " Rank Club Country Level Elo From To\n", "1203829 None Besa Kavaje ALB 0 1325.261230 1972-07-01 1972-09-13\n", "1203830 None Besa Kavaje ALB 0 1337.468506 1972-09-14 1972-09-27\n", "1203831 None Besa Kavaje ALB 0 1338.146362 1972-09-28 1972-10-25\n", "1203832 None Besa Kavaje ALB 0 1335.007324 1972-10-26 1972-11-08\n", "1203833 None Besa Kavaje ALB 0 1334.845581 1972-11-09 1978-07-01" ] }, "execution_count": 62, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Display the first five rows of the raw DataFrame, df_elo_team_ratings_all_raw\n", "df_elo_team_ratings_all_raw.head()" ] }, { "cell_type": "code", "execution_count": 63, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
RankClubCountryLevelEloFromTo
1804701NoneZlatiborYUG11306.6027831992-04-301992-05-03
1804702NoneZlatiborYUG11312.9268801992-05-041992-05-17
1804703NoneZlatiborYUG11312.0773931992-05-181992-05-24
1804704NoneZlatiborYUG11331.3347171992-05-251992-06-29
1804705NoneZlatiborYUG11331.3347171992-06-301995-07-01
\n", "
" ], "text/plain": [ " Rank Club Country Level Elo From To\n", "1804701 None Zlatibor YUG 1 1306.602783 1992-04-30 1992-05-03\n", "1804702 None Zlatibor YUG 1 1312.926880 1992-05-04 1992-05-17\n", "1804703 None Zlatibor YUG 1 1312.077393 1992-05-18 1992-05-24\n", "1804704 None Zlatibor YUG 1 1331.334717 1992-05-25 1992-06-29\n", "1804705 None Zlatibor YUG 1 1331.334717 1992-06-30 1995-07-01" ] }, "execution_count": 63, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Display the last five rows of the raw DataFrame, df_elo_team_ratings_all_raw\n", "df_elo_team_ratings_all_raw.tail()" ] }, { "cell_type": "code", "execution_count": 64, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "(1854899, 7)\n" ] } ], "source": [ "# Print the shape of the raw DataFrame, df_elo_team_ratings_all_raw\n", "print(df_elo_team_ratings_all_raw.shape)" ] }, { "cell_type": "code", "execution_count": 65, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Index(['Rank', 'Club', 'Country', 'Level', 'Elo', 'From', 'To'], dtype='object')\n" ] } ], "source": [ "# Print the column names of the raw DataFrame, df_elo_team_ratings_all_raw\n", "print(df_elo_team_ratings_all_raw.columns)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The dataset has twelve features (columns)." ] }, { "cell_type": "code", "execution_count": 66, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Rank object\n", "Club object\n", "Country object\n", "Level int64\n", "Elo float64\n", "From object\n", "To object\n", "dtype: object" ] }, "execution_count": 66, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Data types of the features of the raw DataFrame, df_elo_team_ratings_all_raw\n", "df_elo_team_ratings_all_raw.dtypes" ] }, { "cell_type": "code", "execution_count": 67, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "Int64Index: 1854899 entries, 1203829 to 1804705\n", "Data columns (total 7 columns):\n", " # Column Dtype \n", "--- ------ ----- \n", " 0 Rank object \n", " 1 Club object \n", " 2 Country object \n", " 3 Level int64 \n", " 4 Elo float64\n", " 5 From object \n", " 6 To object \n", "dtypes: float64(1), int64(1), object(5)\n", "memory usage: 113.2+ MB\n" ] } ], "source": [ "# Info for the raw DataFrame, df_elo_team_ratings_all_raw\n", "df_elo_team_ratings_all_raw.info()" ] }, { "cell_type": "code", "execution_count": 68, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
LevelElo
count1.854899e+061.854899e+06
mean1.189897e+001.519541e+03
std4.280279e-011.660081e+02
min0.000000e+006.492441e+02
25%1.000000e+001.408781e+03
50%1.000000e+001.524152e+03
75%1.000000e+001.642937e+03
max2.000000e+002.107799e+03
\n", "
" ], "text/plain": [ " Level Elo\n", "count 1.854899e+06 1.854899e+06\n", "mean 1.189897e+00 1.519541e+03\n", "std 4.280279e-01 1.660081e+02\n", "min 0.000000e+00 6.492441e+02\n", "25% 1.000000e+00 1.408781e+03\n", "50% 1.000000e+00 1.524152e+03\n", "75% 1.000000e+00 1.642937e+03\n", "max 2.000000e+00 2.107799e+03" ] }, "execution_count": 68, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Description of the raw DataFrame, df_elo_team_ratings_all_raw, showing some summary statistics for each numberical column in the DataFrame\n", "df_elo_team_ratings_all_raw.describe()" ] }, { "cell_type": "code", "execution_count": 69, "metadata": { "scrolled": true }, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 69, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAABvEAAAHMCAYAAADs7YSNAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8rg+JYAAAACXBIWXMAAAsTAA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Rx11VB5++OH07t07CxYsqMUJAeD7q6y2B4Dvq+rq6tStWzd9+vRJo0aNMnbs2AwYMCCXX355VllllXz44YdZtGhRFi5cmPLy8i/8riABX1RRUZGPP/44a665ZurWrZskuemmmzJlypTUr18/HTp0SJcuXWp5Svh+KCkpSUVFRYYPH56JEydmq622ylprrZUkOfDAA1NSUpJLLrkkSXLWWWdlp512ymabbZZp06Zl8803T2lpqTPw4HOqqqpqtokLLrggL730UqZOnZqtttoqXbp0yX777ZeysrKcf/75Oeyww2rOyLMtAVBbPv8eVFpamkMPPTRHHnlkFi1alLZt2+acc85J//79c8UVV6R+/fq1OC0AfP+4nCZ8i5ZcAqmioiI33nhjxo4dm8033zwbb7xxRowYkVatWqVJkybZZZddss4666RTp06pU6dOVlllldoeHQpn0aJFOfroo7PKKqtk4MCBadGiRU488cQ8++yzadWqVSoqKvLyyy/nkEMOSY8ePWpiA7Bilv6i5tlnn81FF12U119/Pcccc0z69OlTc6DJnDlzMnbs2Fx66aU55JBDcsYZZ3zp8wDLGjBgQJ599tl07do1q6++eh577LG8/PLL6dKlSwYNGpRHHnkkl112WZLkxhtvzNprr13LEwPw/6KlL+t85ZVX5oMPPsgDDzxQ87kwSRYsWJDHH38855xzTrbddlshDwC+Yc7Eg2/Bki8ul9zjpF69ejn66KOTJPfee2/++te/ZuONN86uu+6aN998M2PGjMns2bNTWVmZzTbbLLfffnvq1atXy2sBxVK3bt1sttlmue+++3Lddddl2223zbRp03LZZZdl2223zZw5c/Lwww9nyJAhmTt3bi644IKUlXmbgxVVWlqaBQsW5IMPPsjWW2+dk08+OVdccUVuvPHGtG3bNp07d06SlJeX54ADDkhJSUmGDh2ali1b5vDDD1/meYAveuGFF/Lss8/mrLPOSqdOnVK/fv20bt06hx56aFZaaaXMnDkznTt3TllZWc4666z06dMnv/3tb1NSUuJKDQD8zywd8AYMGJDHH388G220UUpKSvLEE09kzz33zAYbbJAGDRpkt912S5IMGTIkPXr0yMiRI4U8APiG+HYTvmFLn3lwzz335OOPP87666+fXXfdNcccc0yS5I477khVVVX69++fJPnggw/yz3/+M48//ng6d+4s4MHnLNmBPO2001JeXp477rgj77zzTioqKtKuXbuUlpamadOmOeCAA9KgQYMMGDAg22yzTQ488MDaHh2+c6qrq3PKKafkmWeeya233poOHTqkf//++eUvf5mLLrooJSUlNV/UlJeXZ7/99suqq66aH//4x7U8ORTT589KnT17dj755JO0atUq9evXz9SpU9OnT5/stdde2XPPPXPppZfmqKOOyi677JIhQ4Zk4403FsUB+J9bEvCmTZuWGTNmZOTIkVlnnXUyderU/OIXv8gFF1yQc889t+b9bLfddktFRUWuvPLKfPLJJ1lzzTVreQ0A4PvB5TThG7T0vez69u2bp556KqWlpZk9e3aOPPLIDBw4MFVVVbnpppty6623ZvPNN8/FF1+clVZaqZYnh2L7/BegV1xxRa6//vrUq1cv9957b9Zdd90kn8W+BQsW1ATyK6+8MvXq1XPmAqyg1157LQMGDMjixYtz+eWXp23btnn66adzzTXX5IMPPsjpp59eE/KWtnjxYmfAwpf4y1/+kh122CH/+Mc/cvDBB+f2229P69at07lz5/zwhz/MJZdckk8++SS77LJLzj777Bx00EG1PTIA/48bNGhQ/vrXv6ZBgwYZOXJkVl999STJM888k5NOOimbbbZZBg8enJYtWyZJFi5cmEWLFqW8vLw2xwaA75WS2h4Avi+qqqpqQsFTTz2VKVOm5IYbbsioUaNyxhln5NZbb82wYcNSp06dHHXUUTnssMPyxhtvpHfv3pk7d24tTw/FtiTgjR49OknSr1+/nHTSSamurs5vfvObTJ8+PclnR4s2atQojRs3zqeffpr69esLePAfLF68eJk/V1ZWpnXr1hk+fHhKSkrSv3//TJ48OR07dswJJ5yQtdZaKxdddFH+9Kc/feG5BDxYvj/+8Y85+uij884772TLLbfMDjvskNNOOy0777xzdtlll5x33nkpKSnJjBkzssYaa6RFixa1PTIA5Cc/+UkWLlyYqVOn5rXXXsuS8wA6dOiQK6+8MpMmTcqQIUPy9ttvJ0nq168v4AHAN0zEg2/IkktN/OpXv8rdd9+dH/zgB2nXrl1at26dww47LGeddVZGjRpVE/KOPvro7Lnnnpk9e3b++c9/1vL0UHxPPfVUBg8enJNPPjlJ0qtXrxx11FH505/+lDvuuCPvvvtukuSTTz7JP//5z7Rs2TIVFRW1OTJ8J5SVlWXevHm59tprk3wWzauqqrLBBhvkyiuvXG7Iq1evXh544IFanhy+O7bbbrtsuummueWWW1KnTp0ccMABKS0tTXl5eX7605+mvLw87733XsaMGZOSkpK0bt26tkeGQlrehYSqqqpqYRL4/qmsrPzCz7bffvtcccUVKS8vzzXXXJPXXnut5rEOHTpkxIgRefLJJ3PJJZd84cAwAOCb4XKa8A2aMmVKhg4dmueffz577LFHLrjggmUuA/ib3/wm559/fg499NCccsopqa6uzpw5c7LyyivX8uRQfLNmzco999yTyy+/PD/60Y9y2WWXJUkuv/zyjBkzJquvvno23XTTzJ49O3/729/ym9/8xpeg8BWNHj06gwcPzkEHHZRzzz03yb/uRfnaa6/l+OOPz8orr5zzzjsvm2yySSZNmpS2bdu6Txcsx+cvAb3EhRdemHHjxuXOO+9M06ZN87vf/S5jx47Na6+9llatWmXx4sWZNWtWRo4cmU022aQWJodiW3rbWrBgQRYuXJimTZvW8lTw/bD09jVu3LhMmzYt9evXz+abb55NNtkkEydOzPHHH5+2bdvmjDPOSJs2bWp+99lnn03z5s2z/vrr19b4APC9JuLBf2HJF5xLe/rpp3PTTTflz3/+c2644YbssMMOy9wr74477si5556bY489NgMGDKiNsaHQqqurU11d/YVtK0n++c9/5q677sqll16aLl261IS8a665JiNGjEiLFi2y3377Ze+9984666zzvx4dvjOWfl9KkunTp+e3v/1tRo4cma5du2bIkCFJ/nWPuyuuuCLXXXddVl111YwaNarmPpRfFiuAZPLkydlggw1Sr169JMmcOXOy5557ZrfddquJ5a+++momT56cSZMmZcMNN8wOO+yQVq1a1eLUUExLv99cfPHFee655/LBBx+kRYsW6dGjR7bcckv3GYevaenPhb/4xS8yceLELFq0KMlnB1IOGDAgxxxzTCZOnJhevXpl0003zZlnnpmNN964NscGgP9nuHEJfE1L70i++OKLmTt3brbffvt07NgxjRs3zoIFC9KnT59cffXV6dixY80H44MOOihlZWVp3759La8BFMv8+fMze/bsrL766jU7kVdddVXWWmutHHjggUmSlVZaKd26dUuSXHrppSkpKckll1ySE044IbNnz87TTz+dQw891Jc48G8sCXNL7uU6b968rLHGGjnqqKNSXV2d66+/PkkyZMiQmnvcNWjQIEcddVQWLlyYli1b1jyXgAfLd9lll+X222/P9ttvn5NPPjktW7ZMeXl5DjvssPzhD3/I5MmT07Zt27Rp0yZt2rRJ165da3tkKLQl7zcnn3xyJk6cmD322CPbbbddnnrqqfTt2ze9e/dO9+7dnZkHX8OSfa8RI0bkxRdfzNChQ/ODH/wg77//fn7/+9/n0ksvTWVlZXr27JlrrrkmJ554Yk477bRcfPHF2XDDDWt5egD4/hPx4GtYOuCdeuqpGT9+fD755JNsvfXWOeOMM9KuXbucfPLJueKKK9K7d++akLfkzL0DDjigltcAiqWqqiqnnnpqnnzyydx///1p0aJF/u///i/3339/GjVqlEaNGmWvvfZK8lnI69q1az766KOMHDky5eXlGTRoUE499dR89NFHAh78G5WVlSkrK8vcuXMzZMiQvPXWW3n//fez8847p1u3bunbt2+S1IS80047LW+//XaefPLJ7Lnnnjn00ENrnkfAg3/5/NUZjj766DRu3DiPP/54unXrln333Td77713unbtmptuuikTJkxI27Ztl3tVB+Bf29TSZwj9/e9/z4svvpjBgwdnp512SvLZWUOnnXZarr322rRs2TJ77rmn7Qq+oqW3s8rKyrz44ovZdddd06lTpyRJ06ZNs/7666d+/fq5/PLLs8UWW6RDhw654oorcuaZZ6Zhw4a1vAZQPP/uykLen4Cvy385YAVVV1cvcyTo3/72t5xwwgm56qqr8uabb2bYsGF56aWXssUWW6Rfv35p165dfvGLX+TJJ5/0Zg1foqqqKgcffHBatWqVww8/PNOmTcsGG2yQCy64IA0bNszIkSNz//331yy/8sorp1u3bmnatGlGjx6dU045JUnSvHnz2loF+E4oLS3N/Pnzc9BBB+WNN97I5ptvnh/96Ed56qmn0r9//4wbNy59+/bNcccdl7vuuivbb799jjzyyMybNy8HHXTQMs8DfKaysrLmM96cOXPyzjvvZOWVV06vXr0yZsyYnHTSSXnzzTfTs2fP3HHHHdlqq61y/fXX55133vHZEJajoqIihxxySJ5++unUqVMnS+4AMm3atHzyySfZbLPNkqTmcn/Dhg1L+/bt88tf/jIVFRW2K/gKln7vmjt3burUqZMpU6akbt26Sf61fdWvXz8HHHBANtxww/zpT3/KokWL0qFDh9x///1Ze+21a21+KJqqqqokn53ZumTb+sc//pEnnngi48aN+9KwB/BV+K8HrKAlR4I+8cQTmTRpUi666KIcdthh2XrrrbPllltm4sSJGTx4cCZNmpQtttgi/fv3T4sWLXL22Wdn/vz5cRtK+JeqqqpUVFRk1qxZ2WqrrXLqqaemadOmNSFv2223Tf/+/dOgQYPccMMNue+++2p+d86cOdlyyy1z9dVXp3fv3kmyzD2+gGUtOSr0lltuSVlZWS6//PKcddZZOeuss3L++edno402ytChQ/PCCy+kV69eueOOO9KzZ8/07t07Y8eOTVlZWSorK2t7NaBQqqqqaqL2oEGDcuSRR2avvfbKYYcdlhEjRiRJjjnmmFx44YW56KKL8sADD+Stt97KjBkzMn78eJ8L4XMqKiry4osvJklOPPHETJgwoebzXZ06dVKnTp1MmzYtSVK3bt1UVFQkSQ499NC89957eemll2pncPgOqaioqHnv6tWrV84999yUlpZm4403zhNPPJHq6upltq+WLVumUaNG+fjjj2siX4MGDWptfiiaOXPm5Nxzz82kSZNqfjZgwICccsop6d27d/r165d99903Tz31VM12BbAiRDz4DxYsWJDf/va3GT58eB5++OHMmjUryWdHglZUVGSLLbZIkjz88MOZPXt2zjvvvMyYMSPnnXdeXnzxxbRr1y7Dhg3LqFGj0rBhQ5EB/n9z587NBRdckMMPPzw/+clPcvDBB2fOnDk5+eST07hx42VC3sknn5wGDRrk+uuvz6hRozJ58uSMGTMmc+fOzXbbbZd11123tlcHCmfu3Ln5+OOP8/LLL+eTTz7JokWLUqdOnbzxxhtp1qxZWrZsWXPEaMeOHXPkkUdm8eLF+f3vf5+ysrJsvvnm6dOnTw477LCagOcMPFjWkiOqTz311DzxxBPp0qVLhgwZknXXXTc33nhjevXqlSRp0aJFunTpklGjRuWkk07K7rvvno4dO/pcCEuZM2dOjjjiiLz//vs555xz0q5du/Ts2TMTJkxIkmyxxRZZsGBB7rzzzsyZMyfV1dWpV69ekmTevHlZaaWVstpqq9XmKkBhLYkMVVVVNdvNhAkTMnPmzHTt2jWVlZU59thj8+GHH+b4449Pkprlpk+fnrp166Z169ZJ4gAUWMqcOXOy55575q233kqrVq2SJEOHDs2zzz6bU045JXfccUeuvPLK1KtXL6eeemqefvrpJLYjYMW4Jx78G0vvSH766aeprKxM9+7dc/bZZ2ettdZKaWlpFi9enFdffTUXXnhhTjrppHTr1i0fffRRLrvssgwYMCAHH3xwjjzyyNpeFSiUuXPnpnv37llppZXSvn377Lfffnn22WdTWlqaHXbYIWeffXbOO++8HH744bn11luz7bbbZsCAAbnmmmty4YUXpry8PCUlJfn1r3+dJk2a1PbqQOG8+OKLufbaazN58uTMnDkza6+9dk4//fTsvPPOqayszPvvv5/kswCxePHilJWVZYcddkinTp3y6KOPZsCAAWnQoMEygUHAg+V77bXXMnHixJx22mnZbbfdUq9evay33nq566670qpVq7z11ls1B5usvPLK6dy5c3bffXcBD5YyZ86c7LvvvmnevHk6deqUZs2aZeDAgbnkkkvSo0eP/OpXv0qHDh1y5plnZvDgwWnQoEEOOeSQbLjhhvnggw/y5JNPZu211/a5EJZjyfa12mqrZe7cuWnSpEkuu+yyjB07Nuuvv3623HLLlJaWpm3btunTp0+uuuqq/OxnP8uRRx6Z+fPn5+mnn87UqVMzdOjQJK5+AkvMnTs3Xbt2TZs2bTJkyJCstNJK+fTTTzNp0qQcccQR6dy5c832stVWW6VHjx4ZNmxYtt9++9SvX7+Wpwe+S0Q8+BJz5sxJ165ds/baa+eKK65IkyZN8thjj2XEiBH5yU9+kq233jpDhgxJ48aNM3To0HTp0iVHH310ze9usskmWW+99bLLLrvU7opAwVRUVKR///5ZbbXVMnjw4KyzzjpJku7du9css+WWW+bss8/O4MGDc9hhh+XWW2/NNttsk8GDB+edd97Jhx9+mG233dZ9GGA5nnvuufTo0SO77bZbjjrqqKy77rp55pln0rhx4yTJDjvskKeffjq/+tWvcuyxx6asrCxVVVWpU6dOSktL06pVqzRs2LCW1wK+O+bPn5/p06enWbNmqVevXqZOnZrjjjuu5izzX/7yl9lnn32y88471/yOL0DhX+bMmZOf/vSnWWeddXLxxRenWbNmSZK2bdtm4MCBufDCC9OrV6+MHDky3bt3z6JFizJs2LCMGzcujRs3Tv369fP222/nlltuqfld4DNLvtdo1apVLr744jRp0iQVFRVp2bJlmjVrlvfeey+zZs1KkyZNUl5env333z8tWrTINddckzPOOCPl5eVZa621csstt2S99dar7dWBwpg7d24OOeSQzJkzJ2eeeWbWWmutmp+/+uqr6dKlS83nvaqqqpSXl+ess87Kz3/+84waNarm+0OAr0LEg+VYsiO55IPuGmuskeSzL2muu+66zJo1K02bNk3Hjh2zePHifPrpp9loo42SJB999FHeeOON7LbbbjnhhBOcuQCfM3Xq1EyfPj29e/dOy5Ytk2SZy/RVVlamXr162W677dKvX7/cdNNNOfzww3P77benVatWNZeoAL7o/fffz6BBg7LPPvvkxBNPrPkyc6eddqpZZvfdd89DDz2UsWPHZvHixenTp09KSkry1ltv5fnnn8/mm29eS9PDd1PDhg1TXV2d+fPnZ968eTn44IOzww475MILL8ycOXPy+OOPZ5NNNlkm4gGf+fx+1+qrr56qqqqUlJSkuro6G2ywQYYMGZJzzz03PXv2zMiRI3PooYemXbt2uf/++/Pxxx9nvfXWy9577y0wwOcsb/tasq+19957p2HDhrngggty9tlnZ+TIkalbt27Ky8trzhh/6aWX0rx58zRu3Fggh6UsieMffvhhVl999dxzzz3p2bNnGjVqlJKSkpSXl+fVV1+tWX5JzFt33XVrztYDWBEiHnzO3Llzs99++2WjjTbKeeedlzXWWKPmUmP169fPyiuvvMzZP7NmzUqjRo3y5JNPpqKiIm+99VYmTpyYk046ScCD5XjhhRfy1ltvpV27djX3Elp6WyktLc38+fNz1VVXZdq0aTnuuONy2WWXpWvXrrnvvvtqjnAD/qW6ujp16tTJa6+9lqqqqnTt2rXmy5alI/miRYvStGnTDB06NMcff3zuu+++3H333VlrrbXy4YcfpkGDBjnnnHOWeU74f11FRUWmT5++3INIqqurs+GGG+bHP/5x+vXrl+rq6uy5554588wzU69evcyaNSurrbaa9y5Yjs/vdy0d8CoqKrLjjjtm7733ztlnn51TTz01F198cY499tiaS2tusskmqVu3rvcrWI4v275KS0uzcOHCPPLII9lrr71SXV2d888/P3379s3VV19dc8uQsrKy/OAHP6jt1YDCmTNnTvbaa6+0bt06t912W6688srcf//9qa6uTo8ePbLmmmvmyCOPzEUXXZQtt9wyBx54YM171CeffJLmzZvXfC70/gV8VSW1PQAUSXV1dQYMGJB33nkn3bt3zxprrJHKysqUlZVl4cKFGTp0aBYuXJhPP/00Dz30UN57772suuqqOeWUUzJ79uzce++9mTx5cm644YZsuOGGtb06UEgVFRVp0KBBGjVqlGT5N3Ru2LBhpkyZkilTpmSbbbbJ6aefno022igVFRX/63HhO2HJzt8zzzyT+fPnL3M23dKRvG7dupkxY0aGDBmSNddcMz179kz79u3TokWL/PSnP83vfve7lJWVZfHixXYoIZ9d/uiYY47J0KFDM3Xq1C88vuQytAcccEA222yz1KtXL7vvvnvKy8vz1ltv5aabbsqCBQvSvn37WpgeiuvL9ruWBLz9998/G2ywQc29xdu2bZtTTjklW221Vfr27Zunn346devWrd2VgIL6T9vXPvvsk5EjR6a6ujo//vGPc9ZZZ2XChAnp3bt3qqqqUlZWttx9NPh/XXV1dQYNGpQNN9wwQ4YMydprr52hQ4emffv2+cMf/pCRI0dmzpw56d69e/bbb78MGjQol112WSZMmJC//e1vGTFiRGbOnJlOnTolcXl14KurU+2dGZYxadKknHbaaWnevHn69u2bbbbZpmZH8vXXX8/aa6+duXPn5tNPP039+vWz5ppr5vDDD8+MGTPSq1evLFq0KCuttFJtrwYUzpKjzJ5++un06NEjAwYMqPliZukj0BYtWpS6devmwQcfzOmnn5677rorLVu2zKJFi9ynC/6Dyy67LPfff38eeeSRlJaWfunRnd27d0/dunVz++23f+Gxpc/cAz6L4yeffHI6deqUHj16fOmBWo8++mjuvPPOjB8/Puuuu26qq6uzYMGC/OpXv8omm2zyP54aiu/L9rv222+/lJeX58orr8yaa665zHvZK6+8kmHDhuX//u//8vDDD6dBgwa1vBZQTP9u+2ratGkuu+yymrOB5s+fn4ceeigXXnhhNtxww9x22201V0wBljV9+vTUr18/zZo1qzl7fPHixTnjjDPy7LPP5qc//WmOO+64LFq0KDfffHOuu+66lJaWZqWVVkqjRo1y5ZVXpm3btrW9GsB3jIgHyzF58uScfPLJWWONNXLcccdl6NChadCgQc4999ysssoqmTt3biZNmpS///3vmTBhQs2R2X/+85+z6qqr1vL0UGwfffRRDj744DRq1ChDhgxJu3btknzxUhIjRozIvffem9/97ndp0qRJbY0L3wlLtp8//vGPOeWUU3LOOefkZz/72TKPJf+K5DfeeGNuuumm/O53v8tqq63mixr4DyZOnJgTTjghO++8c3r27LlMyFt6G/vwww8zceLEvP7661lnnXWy9dZbp0WLFrU1NhTel+13DR8+/AuXoV24cGFGjx6dVVZZJdttt13NfcuB5fsq29eS97D58+fn/vvvz7XXXptRo0a5DDR8RUsOgFwS8iZMmJCuXbumR48eadSoUV599dW8//77ady4cdZff33fGQJfi4gHX2LJB9733nsva6+9dsaOHbvcs4Bmz56dadOmpby8fLn3SgG+6Mknn8zxxx+fTp065YQTTqgJeUt8+OGHOfvss9OoUaOanU3gP5s+fXoOOOCArLXWWjn77LNr7mXy+Uh+xhlnZNq0abn11ltra1T4zvmykLfkKOwkmTBhQqZNm5bdd9/dASjwFX1+v+u3v/1tGjVqtMx719y5c3PBBRfUnPG67rrr1vLU8N3wZdvX8ixYsCCLFy9OeXn5/3hK+G5bXsjbZ5990qNHD9sT8I1w2DV8ibZt2+byyy/P6quvniZNmmTy5MlJPvsitLq6OlVVVUmS8vLybLLJJgIerIAdd9wxgwYNylNPPZVzzz03o0ePzqJFi1JRUZHnn38+w4cPz/PPP5/evXsLeLAC1lhjjQwePDivvPJKRowYkX/84x9J/nW/haqqqrz++ut5+eWXs8UWW9TmqPCds9VWW+Waa67JE088keuvv77mSgxLAt4//vGPXHTRRTnttNMyb9682hwVvlM+v9/16quvJskyAe+iiy7KH//4x/z6178W8GAFfNn2lXzx3uQNGjQQHOBrKC0tTWVlZcrKyjJ06NBss802eeCBB3LVVVf5TAh8I5yJB//BkiPXVllllZx00knZeuutk3zxrAZgxT355JMZNGhQZs6cmebNm6ekpCT169dPWVlZLr300rRp06a2R4TvnOrq6owdOzaDBw/O+uuvn3333Tf7779/5s2bl0mTJuWmm27KwoULM2bMmJSVlXk/gxW05Iy8nXbaKSeccELWW2+9TJw4MZdeemlef/313Hrrre6BB1/D0vtdv/jFL7LVVltlzpw5ueiii3Lvvfdm9OjR2XTTTWt7TPhO8r0GfPuWPiPvxBNPzHvvvZdf//rXad68eW2PBnzHiXjwFSz9gbdfv35p3759bY8E3xszZszIc889l2effTaVlZVp165dOnTo4D4n8F/661//mvPPPz/Tpk1L/fr1U1FRkTXWWCPrrrturr766pSVldXsaAIrZknI22WXXdKpU6fceeedefHFFzN69Oi0bdu2tseD76yl97uOP/74PPbYY7nzzjsFPPgG+F4Dvn1Lh7yPPvrI9xrAN0LEg69o8uTJOeWUU1JaWprBgwd/4R5eAFA0H3/8caZOnZrnnnsuDRo0SOvWrbPtttumpKQkixcvTllZWW2PCN9ZEydOTJ8+fTJnzpzUrVs3o0aNEvDgG7Bkv+udd95JVVVVfvOb32SzzTar7bHge8H3GvDtc6Ak8E1zT7z/wvTp07P11lvn5ptvru1R+B9o27Zthg4dmnr16mWVVVap7XHge2Xp40kcWwLfnObNm2fbbbdNjx49cthhh6VDhw4pKSlJVVWVgAf/pa222ipXXXVVmjRp4gw8+Aa1bds2w4YNy/rrr5+xY8cKePAN8r0GfPsEPOCb5ky8r2nu3Lk56qij8vzz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tt946N9988xcemz9/fi699NLstttu2XzzzdOpU6ecc845+fjjj7+w7F/+8pe0adNmuf/74Q9/+G9neOWVV7LZZpvltNNOW+7jjzzySLp3754tttgi7du3z+GHH55nnnlmucs+88wzOeKII9K+fft06NAhvXr1ygsvvPClf2+vXr2yzTbbZJtttsnhhx+ep5566t/OCgAAAAAAACuqbEUWnjt3bvr27Zs5c+Z84bGqqqr06NEjf//737P55punS5cuee211zJmzJg888wzGTt2bJo0aVKz/Kuvvpok6d69e1ZbbbVlnqtRo0ZfOsPixYtzxhlnZPHixct9/Le//W3OOuusNG3aNN26dUtlZWXuu+++HHnkkbnmmmuy66671iz7hz/8IQMHDkxJSUm6dOmSZs2a5ZFHHskhhxyS4cOHp3PnzjXL/u1vf0uPHj2ycOHC7LbbbmnRokWefPLJHHPMMTnrrLNy6KGHfrV/RAAAAAAAgP/CXXfdldNPP325jz3++ONZe+21/8cT8e983dfrK0e8d999N3379s2kSZOW+/jDDz+cv//97/nRj36Uq666KiUln53kd/nll+e6667LLbfckj59+tQsvyTiDRw4cJm495/ccMMNefnll5f72KJFi3LppZemSZMmueuuu9KyZcskyc9//vMccMABOf/882si3uzZszNo0KCUlJTktttuS/v27ZMkffv2zUEHHZQzzzwz22yzTZo1a5bKysqcccYZWbBgQa688srsscceSZIFCxbk2GOPzbBhw9KpU6est956X3k9AAAAAAAAvo4999wzO+64Y82fq6qqcvzxx6dly5YCXgF93dfrK11O8+abb84+++yTyZMnZ/vtt1/uMi+++GKSZL/99qsJeEnys5/9LEny3HPPLbP8q6++mhYtWqxQwJs6dWquvvrq7Lzzzst9/O23386sWbOy/fbb1wS8JGnTpk223HLLTJs2LTNnzkySjB8/PrNnz063bt1qAl6SNGvWLL17986sWbNyzz331KzbO++8k06dOtUEvCRp0KBB+vfvn0WLFuX222//yusBAAAAAADwdTVo0CCrrbZazf8efvjhvPfeeznvvPNqezSW4+u+Xl8p4t16661p0aJFbr/99nTt2nW5yzRr1ixJ8t577y3z8+nTpydJmjdvXvOzysrKTJ06Na1bt/4qf32Sz6rkmWeemRYtWqR3794rNEN1dXVmzJiRunXr1kTDadOmJUm23HLLLzxPmzZtkiTPPvvsV1524sSJX3ldAAAAAAAAvglz5szJiBEjcuKJJ6Zp06a1Pc5/raKioqbP3HLLLamoqKjlib5ZK/J6faWIN3jw4Nxzzz3ZaqutvnSZvffeO02aNMnVV1+dJ554IvPmzctLL72UQYMGpW7duvn5z39es+wbb7yRhQsXpkGDBhk4cGB23HHHbLHFFjn44IMzfvz45T7/rbfemueeey7nn39+6tWrt9xlVllllfz4xz/OpEmTcumll+bjjz/ORx99lPPOOy9vvvlmDj744NSvXz9Jap5jeS/+7Nmzk3x2CdH/tOyS+wMuWRYAAAAAAOB/ZcyYMalXr14OPPDA2h7lv1ZRUZEDDjig5uqOo0aNygEHHPC9Cnkr8np9pYi34447prS09N8us+aaa+b222/PKquskp49e6Z9+/bZf//9M2PGjNx8883ZYostapZdcj+8P/3pT5k2bVr22WefdO7cOS+//HJ69uyZsWPHLvPc77zzTq688sp0794922yzzb+d45JLLkn37t0zcuTIdOzYMTvssENGjRqVY489dpmbBm6++eZJPruX3+c99thjSf4V6DbbbLMkn91ccPHixcss++ijjy6zLAAAAAAAwP9CdXV1xowZk0MPPTR169at7XH+a6NGjao50WqJ2bNnZ9SoUbU00TdrRV+vsm/qL543b15++ctfZsqUKenQoUM222yzvPHGGxk3blzOOeec3HDDDTU351uwYEHWWWedHHjggenZs2fNc0yZMiXdu3fPeeedl1122SWrrrpqkuSss85KkyZNMnDgwP84xz333JP77rsva6+9dnbdddcsXLgwjz76aEaNGpWNNtoo++23X5Jkm222yQ9+8IP8+c9/zrnnnpuePXumYcOGuf/++/Ob3/wmdevWTXV1dZKkRYsW6dKlSx588MH069cv/fv3z6qrrppx48bl8ssvT8OGDf9tBR43btzX/WcF/gPbF3x7bF/w7bBtwbfH9gXfDtsWfHtsX8B/a9KkSXn77be/9FZo3zUvvvjicn/+0ksv/Y8n+Xas6Ov1jUW8Cy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zZJsscee2TChAkZPnx4rr322pSVfTbGxIkTc+edd2adddbJjjvumLKysmyyySZf+PteeeWVjBkzJptsskn69u1b8/Of/OQn+f3vf58rrrgiN954Yxo2bJgk+ec//5krr7wySbLXXnslSdZYY43Uq1cvf/jDH9K7d++af7S//OUvGTNmTNq0aZOddtopyWf3vltzzTUzfvz4vPXWW1l33XWTJJMnT861116bVVddNd26dfsm/ikBAAAAAAC+khdeeKG2R2AFrOjr9Y1EvCQ544wz8sILL+T888/PY489lk033TRvv/12HnnkkTRs2DDDhg2ruXTmQQcdlAcffDDjx4/Pvvvum06dOuX999/Po48+mrp16+ayyy6rCXsrYtddd023bt1y1113Za+99sruu++eioqKPPbYY5kxY0Z69uyZLbfccpmZTzjhhHTr1i0/+tGPMmvWrPzpT39Kw4YNc/HFFy9zqc9TTz01Bx10ULp375699947FRUV+cMf/pCKior86le/qgmGAAAAAAAA8N+qU11dXb0iv3DXXXfl9NNPz+mnn54jjzxymcdmzpyZq6++Oo8//ng+/PDDNG3aNB07dkyfPn2y/vrrL7NsRUVFrrvuutx///159913U15eno4dO+bEE0/8wrKf98orr2TffffNfvvtl2HDhi3zWHV1de68886MGTMmU6dOTZ06ddKmTZscfvjhNWfhLW38+PG55ppr8tprr6Vx48bZfvvt06dPn5qz7Zb2wgsv5PLLL8/LL7+c0tLStG/fPn369Mmmm276Ff/1AAAAAAAA4D9b4YgHAAAAAAAAfLtKansAAAAAAAAAYFkiHgAAAAAAABSMiAcAAAAAAAAFI+IBAAAAAABAwYh4AAAAAAAAUDAiHgAAAAAAABSMiAcAAAAAAAAFI+IBAAAAAABAwYh4AAAAAAAAUDAiHgAAAAAAABTM/weu1pfBR80sQgAAAABJRU5ErkJggg==\n", "text/plain": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# Plot visualisation of the missing values for each feature of the raw DataFrame, df_elo_team_ratings_all_raw\n", "msno.matrix(df_elo_team_ratings_all_raw, figsize = (30, 7))" ] }, { "cell_type": "code", "execution_count": 70, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Series([], dtype: int64)" ] }, "execution_count": 70, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Counts of missing values\n", "null_value_stats = df_elo_team_ratings_all_raw.isnull().sum(axis=0)\n", "null_value_stats[null_value_stats != 0]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The visualisation shows us very quickly that there are no missing values." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "---\n", "\n", "\n", "\n", "## 4. Data Engineering\n", "Before we answer the questions in the brief through [Exploratory Data Analysis (EDA)](#section5), we'll first need to clean and wrangle the datasets to a form that meet our needs." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "### 4.1. Assign Raw DataFrames to New Engineered DataFrames" ] }, { "cell_type": "code", "execution_count": 71, "metadata": {}, "outputs": [], "source": [ "# Assign Raw DataFrames to new Engineered DataFrames\n", "df_elo_team_ratings_all = df_elo_team_ratings_all_raw.copy()" ] }, { "cell_type": "code", "execution_count": 72, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
RankClubCountryLevelEloFromTo
1203829NoneBesa KavajeALB01325.2612301972-07-011972-09-13
1203830NoneBesa KavajeALB01337.4685061972-09-141972-09-27
1203831NoneBesa KavajeALB01338.1463621972-09-281972-10-25
1203832NoneBesa KavajeALB01335.0073241972-10-261972-11-08
1203833NoneBesa KavajeALB01334.8455811972-11-091978-07-01
\n", "
" ], "text/plain": [ " Rank Club Country Level Elo From To\n", "1203829 None Besa Kavaje ALB 0 1325.261230 1972-07-01 1972-09-13\n", "1203830 None Besa Kavaje ALB 0 1337.468506 1972-09-14 1972-09-27\n", "1203831 None Besa Kavaje ALB 0 1338.146362 1972-09-28 1972-10-25\n", "1203832 None Besa Kavaje ALB 0 1335.007324 1972-10-26 1972-11-08\n", "1203833 None Besa Kavaje ALB 0 1334.845581 1972-11-09 1978-07-01" ] }, "execution_count": 72, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_elo_team_ratings_all.head()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "### 4.2. Converting Data Types" ] }, { "cell_type": "code", "execution_count": 73, "metadata": {}, "outputs": [], "source": [ "df_elo_team_ratings_all['From'] = pd.to_datetime(df_elo_team_ratings_all['From'])\n", "df_elo_team_ratings_all['To'] = pd.to_datetime(df_elo_team_ratings_all['To'])" ] }, { "cell_type": "code", "execution_count": 74, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Rank object\n", "Club object\n", "Country object\n", "Level int64\n", "Elo float64\n", "From datetime64[ns]\n", "To datetime64[ns]\n", "dtype: object" ] }, "execution_count": 74, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_elo_team_ratings_all.dtypes" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "### 4.3. Create New Attributes" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "##### Days" ] }, { "cell_type": "code", "execution_count": 75, "metadata": {}, "outputs": [], "source": [ "df_elo_team_ratings_all['Days'] = df_elo_team_ratings_all['To'] - df_elo_team_ratings_all['From']" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "##### Year" ] }, { "cell_type": "code", "execution_count": 85, "metadata": {}, "outputs": [], "source": [ "df_elo_team_ratings_all['Year_From'] = pd. DatetimeIndex(df_elo_team_ratings_all['From']).year" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "### 4.4. Rename Attributes" ] }, { "cell_type": "code", "execution_count": 157, "metadata": {}, "outputs": [], "source": [ "df_elo_team_ratings_all = df_elo_team_ratings_all.rename(columns={'Level': 'Domestic Division'})" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "### 4.5. Aggregated data to one row per Team, per Season/Year\n", "\n", "Two methodologies:\n", "1. Take the last Elo value per year for each team (bad hack, but does give you each Team's Elo rating near the start of the season)\n", "2. Resample the data - using pandas [resample](https://pandas.pydata.org/pandas-docs/dev/reference/api/pandas.DataFrame.resample.html) function" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "#### 4.5.1. Take the last Elo value per team, per year\n", "Take the last value per year as that year's valuation. Ideally, this would be the date closest to September (start of the season), but for now, the current code is fine." ] }, { "cell_type": "code", "execution_count": 158, "metadata": { "scrolled": true }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
RankClubCountryDomestic DivisionEloYear
0NoneAEKGRE11351.6225591959
1NoneAEKGRE11385.2606201960
2NoneAEKGRE11433.5935061961
3NoneAEKGRE11361.0754391962
4NoneAEKGRE11370.9329831963
5NoneAEKGRE11363.3676761964
6NoneAEKGRE11384.0222171965
7NoneAEKGRE11325.1304931966
8NoneAEKGRE11359.5870361967
9NoneAEKGRE11396.0726321968
\n", "
" ], "text/plain": [ " Rank Club Country Domestic Division Elo Year\n", "0 None AEK GRE 1 1351.622559 1959\n", "1 None AEK GRE 1 1385.260620 1960\n", "2 None AEK GRE 1 1433.593506 1961\n", "3 None AEK GRE 1 1361.075439 1962\n", "4 None AEK GRE 1 1370.932983 1963\n", "5 None AEK GRE 1 1363.367676 1964\n", "6 None AEK GRE 1 1384.022217 1965\n", "7 None AEK GRE 1 1325.130493 1966\n", "8 None AEK GRE 1 1359.587036 1967\n", "9 None AEK GRE 1 1396.072632 1968" ] }, "execution_count": 158, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Take the last Elo value per Team, per Year\n", "df_elo_team_ratings_all_grouped = (df_elo_team_ratings_all\n", " .loc[df_elo_team_ratings_all.groupby(['Club', 'Country', 'Year_From']).From.idxmax(axis=0, skipna=True)]\n", " .reset_index(drop=True)\n", " )\n", "\n", "# Drop unnecessary columns\n", "df_elo_team_ratings_all_grouped = (df_elo_team_ratings_all_grouped\n", " .drop(['From', 'To', 'Days'], axis=1)\n", " .rename(columns={'Year_From': 'Year'})\n", " .drop_duplicates()\n", " )\n", "\n", "# Diplay DataFrame\n", "df_elo_team_ratings_all_grouped.head(10)" ] }, { "cell_type": "code", "execution_count": 159, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(37334, 6)" ] }, "execution_count": 159, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_elo_team_ratings_all_grouped.shape" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "#### 4.5.2. Resample the data\n", "Take the average Elo value per year using pandas [resample](https://pandas.pydata.org/pandas-docs/dev/reference/api/pandas.DataFrame.resample.html) function.\n", "\n", "THIS IS CURRENTLY NOT WORKING, BUT IS THE BETTER SOLUTION." ] }, { "cell_type": "code", "execution_count": 160, "metadata": {}, "outputs": [], "source": [ "#df_elo_team_ratings_all_grouped = df_elo_team_ratings_all['Elo'].resample('w').mean()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "### 4.6. Filter Teams in 'Big 5' European Leagues\n", "No MLS data in the dataset currently, so those teams cannot be included." ] }, { "cell_type": "code", "execution_count": 161, "metadata": {}, "outputs": [], "source": [ "# Filter list of 'Big 5' European Leagues and MLS from DataFrame\n", "df_elo_team_ratings_all_grouped_big5 = df_elo_team_ratings_all_grouped[df_elo_team_ratings_all_grouped['Country'].isin(lst_countries_big5)]\n", "\n", "# Sort DataFrame by Country/Club\n", "df_elo_team_ratings_all_grouped_big5 = df_elo_team_ratings_all_grouped_big5.sort_values(['Country', 'Club', 'Year'], ascending=[True, True, True])\n", "\n", "# Drop duplicates\n", "df_elo_team_ratings_all_grouped_big5 = df_elo_team_ratings_all_grouped_big5.drop_duplicates()" ] }, { "cell_type": "code", "execution_count": 162, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(12323, 6)" ] }, "execution_count": 162, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_elo_team_ratings_all_grouped_big5.shape" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "### 4.7. Filter for 2015/2016 Season Onwards\n", "Separate DataFrame created for transfers from 2015/2016 onwards as this is when the other data sources such as FBref start." ] }, { "cell_type": "code", "execution_count": 163, "metadata": {}, "outputs": [], "source": [ "# Filter plays in the Big 5 European Leagues\n", "\n", "## Define list of countries\n", "lst_seasons_1516_2122 = [2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022]\n", "\n", "## Filter list of Big 5 European League countries from DataFrame\n", "df_elo_team_ratings_all_grouped_big5_1516_present = df_elo_team_ratings_all_grouped_big5[df_elo_team_ratings_all_grouped_big5['Year'].isin(lst_seasons_1516_2122)]" ] }, { "cell_type": "code", "execution_count": 164, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(1536, 6)" ] }, "execution_count": 164, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_elo_team_ratings_all_grouped_big5_1516_present.shape" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "### 4.8. Map Seasons" ] }, { "cell_type": "code", "execution_count": 165, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/opt/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:2: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame.\n", "Try using .loc[row_indexer,col_indexer] = value instead\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " \n" ] } ], "source": [ "# Map season to DataFrame\n", "df_elo_team_ratings_all_grouped_big5_1516_present['Season'] = df_elo_team_ratings_all_grouped_big5_1516_present['Year'].map(dict_seasons)" ] }, { "cell_type": "code", "execution_count": 166, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
RankClubCountryDomestic DivisionEloYearSeason
19878ArsenalENG11844.67065420152015/2016
19888ArsenalENG11868.98669420162016/2017
198914ArsenalENG11843.74279820172017/2018
199014ArsenalENG11834.14782720182018/2019
199118ArsenalENG11791.20288120192019/2020
........................
35189NoneVicenzaITA21341.56433120172017/2018
35190NoneVicenzaITA21384.24682620202020/2021
35191NoneVicenzaITA21389.42492720212021/2022
35448NoneVirtus LancianoITA21377.38745120152015/2016
35449NoneVirtus LancianoITA21355.02099620162016/2017
\n", "

1536 rows × 7 columns

\n", "
" ], "text/plain": [ " Rank Club Country Domestic Division Elo Year \\\n", "1987 8 Arsenal ENG 1 1844.670654 2015 \n", "1988 8 Arsenal ENG 1 1868.986694 2016 \n", "1989 14 Arsenal ENG 1 1843.742798 2017 \n", "1990 14 Arsenal ENG 1 1834.147827 2018 \n", "1991 18 Arsenal ENG 1 1791.202881 2019 \n", "... ... ... ... ... ... ... \n", "35189 None Vicenza ITA 2 1341.564331 2017 \n", "35190 None Vicenza ITA 2 1384.246826 2020 \n", "35191 None Vicenza ITA 2 1389.424927 2021 \n", "35448 None Virtus Lanciano ITA 2 1377.387451 2015 \n", "35449 None Virtus Lanciano ITA 2 1355.020996 2016 \n", "\n", " Season \n", "1987 2015/2016 \n", "1988 2016/2017 \n", "1989 2017/2018 \n", "1990 2018/2019 \n", "1991 2019/2020 \n", "... ... \n", "35189 2017/2018 \n", "35190 2020/2021 \n", "35191 2021/2022 \n", "35448 2015/2016 \n", "35449 2016/2017 \n", "\n", "[1536 rows x 7 columns]" ] }, "execution_count": 166, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_elo_team_ratings_all_grouped_big5_1516_present" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "---\n", "\n", "\n", "\n", "## 5. Exporting the Engineered DataFrames\n", "Export the two engineered [Club ELO](http://clubelo.com/) DataFrames as CSV files." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "##### All" ] }, { "cell_type": "code", "execution_count": 173, "metadata": {}, "outputs": [], "source": [ "# Export DataFrame\n", "\n", "## Save latest version\n", "df_elo_team_ratings_all.to_csv(data_dir_elo + '/raw/ratings_by_team/elo_team_ratings_all_combined_latest.csv', index=None, header=True)\n", "\n", "## Save a copy to archive folder (dated)\n", "df_elo_team_ratings_all.to_csv(data_dir_elo + f'/raw/ratings_by_team/archive/elo_team_ratings_all_combined_last_updated_{today}.csv', index=None, header=True)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "##### Aggregated Elo rating per Year, per Team" ] }, { "cell_type": "code", "execution_count": 174, "metadata": {}, "outputs": [], "source": [ "# Export DataFrame\n", "\n", "## Save latest version\n", "df_elo_team_ratings_all_grouped.to_csv(data_dir_elo + '/engineered/ratings_by_team/elo_team_rating_per_year_all_latest.csv', index=None, header=True)\n", "\n", "## Save a copy to archive folder (dated)\n", "df_elo_team_ratings_all_grouped.to_csv(data_dir_elo + f'/engineered/ratings_by_team/archive/elo_team_rating_per_year_all_last_updated_{today}.csv', index=None, header=True)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "##### 'Big 5' European League Countries with aggregated Elo rating per Year, per Team" ] }, { "cell_type": "code", "execution_count": 176, "metadata": {}, "outputs": [], "source": [ "# Export DataFrame\n", "\n", "## Save latest version\n", "df_elo_team_ratings_all_grouped_big5.to_csv(data_dir_elo + '/engineered/ratings_by_team/elo_team_rating_per_year_big5_latest.csv', index=None, header=True)\n", "\n", "## Save a copy to archive folder (dated)\n", "df_elo_team_ratings_all_grouped_big5.to_csv(data_dir_elo + f'/engineered/ratings_by_team/archive/elo_team_rating_per_year_big5_last_updated_{today}.csv', index=None, header=True)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "##### 'Big 5' European League Countries with aggregated Elo rating per Year, per Team" ] }, { "cell_type": "code", "execution_count": 177, "metadata": {}, "outputs": [], "source": [ "# Export DataFrame\n", "\n", "## Save latest version\n", "df_elo_team_ratings_all_grouped_big5_1516_present.to_csv(data_dir_elo + '/engineered/ratings_by_team/elo_team_rating_per_year_big5_1516_2122_latest.csv', index=None, header=True)\n", "\n", "## Save a copy to archive folder (dated)\n", "df_elo_team_ratings_all_grouped_big5_1516_present.to_csv(data_dir_elo + f'/engineered/ratings_by_team/archive/elo_team_rating_per_year_big5_1516_2122_last_updated_{today}.csv', index=None, header=True)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "---\n", "\n", "\n", "\n", "## 6. Summary\n", "This Jupyter notebook engineered scraped football data from [Club ELO](http://clubelo.com/) using [pandas](http://pandas.pydata.org/) for data manipulation through DataFrames." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "---\n", "\n", "\n", "\n", "## 7. Next Steps\n", "The step is to use this data to..." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "---\n", "\n", "\n", "\n", "## 8. References\n", "\n", "* \n", "* \n", "* " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "---\n", "\n", "***Visit my website [eddwebster.com](https://www.eddwebster.com) or my [GitHub Repository](https://github.com/eddwebster) for more projects. If you'd like to get in contact, my Twitter handle is [@eddwebster](http://www.twitter.com/eddwebster) and my email is: edd.j.webster@gmail.com.***" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "[Back to the top](#top)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.6" }, "varInspector": { "cols": { "lenName": 16, "lenType": 16, "lenVar": 40 }, "kernels_config": { "python": { "delete_cmd_postfix": "", "delete_cmd_prefix": "del ", "library": "var_list.py", "varRefreshCmd": "print(var_dic_list())" }, "r": { "delete_cmd_postfix": ") ", "delete_cmd_prefix": "rm(", "library": "var_list.r", "varRefreshCmd": "cat(var_dic_list()) " } }, "oldHeight": 642, "position": { "height": "664px", "left": "1119px", "right": "20px", "top": "-7px", "width": "489px" }, "types_to_exclude": [ "module", "function", "builtin_function_or_method", "instance", "_Feature" ], "varInspector_section_display": "block", "window_display": false } }, "nbformat": 4, "nbformat_minor": 2 }