Notebook first written: 02/12/2020
Notebook last updated: 07/12/2020
Click here to jump straight to the Exploratory Data Analysis section and skip the Task Brief, Data Sources, and Data Engineering sections. Or click here to jump straight to the Conclusion.
This notebook engineers the aggregated performance Excel data available from Opta as part of the #mcfcanalytics initiative for the 11/12 Premier League season using pandas for data manipulation through DataFrames.
For more information about this notebook and the author, I'm available through all the following channels:
This notebook was written using Python 3 and requires the following libraries:
Jupyter notebooks
for this notebook environment with which this project is presented;NumPy
for multidimensional array computing;pandas
for data analysis and manipulation; andmatplotlib
for data visualisations;All packages used for this notebook except for BeautifulSoup can be obtained by downloading and installing the 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 and Mac here, as well as in the Anaconda documentation itself here.
# Python ≥3.5 (ideally)
import platform
import sys, getopt
assert sys.version_info >= (3, 5)
import csv
import xml.etree.ElementTree as et
# Import Dependencies
%matplotlib inline
# Math Operations
import numpy as np
from math import pi
# Datetime
import datetime
from datetime import date
#from datetime import datetime as dt
import time
# Data Preprocessing
import pandas as pd
import os
import re
import random
from io import BytesIO
from pathlib import Path
# Reading directories
import glob
import os
# Working with JSON
import json
from pandas.io.json import json_normalize
from ast import literal_eval
# Data Visualisation
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
plt.style.use('seaborn-whitegrid')
import missingno as msno
from tabulate import tabulate
# Display in Jupyter
from IPython.display import Image, Video, YouTubeVideo
from IPython.core.display import HTML
# Ignore Warnings
import warnings
warnings.filterwarnings(action="ignore", message="^internal gelsd")
print('Setup Complete')
Setup Complete
# Python / module versions used here for reference
print('Python: {}'.format(platform.python_version()))
print('NumPy: {}'.format(np.__version__))
print('pandas: {}'.format(pd.__version__))
print('matplotlib: {}'.format(mpl.__version__))
print('Seaborn: {}'.format(sns.__version__))
Python: 3.7.6 NumPy: 1.18.1 pandas: 1.0.1 matplotlib: 3.1.3 Seaborn: 0.10.0
# Define today's date
today = datetime.datetime.now().strftime('%d/%m/%Y').replace('/', '')
# Set up initial paths to subfolders
base_dir = os.path.join('..', '..', )
data_dir = os.path.join(base_dir, 'data')
data_dir_opta = os.path.join(base_dir, 'data', 'opta')
data_dir_fixtures = os.path.join(base_dir, 'data', 'fixtures')
img_dir = os.path.join(base_dir, 'img')
fig_dir = os.path.join(base_dir, 'img', 'fig')
video_dir = os.path.join(base_dir, 'video')
pd.set_option('display.max_columns', None)
This Jupyter notebook explores how to parse publicly available Event data from Opta using pandas for data manipulation through DataFrames.
In this analysis, we're looking specifically at Premier League for the 11/12 season.
The engineered event data roduced in this notebook is exported to CSV. This data can be further analysed in Python, joined to other datasets, or explored using Tableau, PowerBI, Microsoft Excel.
Opta are a football analytics and data company.
The data needs to be imported as a DataFrame in the Data Sources section Section 3 and cleaned in the Data Engineering section Section 4.
The Opta data made available for the #mcfcanalytics initiative is available in two sources:
The data import is divided into these two sections.
We'll be using the pandas library to import our data to this workbook as a DataFrame.
# #mcfcanalytics - Head of Performance Analysis explains concept.
YouTubeVideo('ikm52r7RlKc')
The Opta dataset has one hundred and fourteen features (columns) with the following definitions and data types:
Feature | Data type |
---|---|
id |
object |
index |
object |
period |
object |
timestamp |
object |
minute |
object |
second |
object |
possession |
object |
duration |
object |
type.id |
object |
type.name |
object |
possession_team.id |
object |
For a full list of definitions, see the official documentation [link].
# Import XLS file of aggregated performance data as a pandas DataFrame
df_opta_mbm_raw = pd.read_excel(data_dir_opta + '/raw/match_by_match/' + 'opta_match_by_match_pl_1112.xls')
Let's quality of the dataset by looking first and last rows in pandas using the head() and tail() methods.
# Display the first 5 rows of the raw DataFrame, df_opta_mbm_raw
df_opta_mbm_raw.head()
Date | Player ID | Player Surname | Player Forename | Team | Team Id | Opposition | Opposition id | Venue | Position Id | Appearances | Time Played | Starts | Substitute On | Substitute Off | Goals | First Goal | Winning Goal | Shots On Target inc goals | Shots Off Target inc woodwork | Blocked Shots | Penalties Taken | Penalty Goals | Penalties Saved | Penalties Off Target | Penalties Not Scored | Direct Free-kick Goals | Direct Free-kick On Target | Direct Free-kick Off Target | Blocked Direct Free-kick | Goals from Inside Box | Shots On from Inside Box | Shots Off from Inside Box | Blocked Shots from Inside Box | Goals from Outside Box | Shots On Target Outside Box | Shots Off Target Outside Box | Blocked Shots Outside Box | Headed Goals | Headed Shots On Target | Headed Shots Off Target | Headed Blocked Shots | Left Foot Goals | Left Foot Shots On Target | Left Foot Shots Off Target | Left Foot Blocked Shots | Right Foot Goals | Right Foot Shots On Target | Right Foot Shots Off Target | Right Foot Blocked Shots | Other Goals | Other Shots On Target | Other Shots Off Target | Other Blocked Shots | Shots Cleared off Line | Shots Cleared off Line Inside Area | Shots Cleared off Line Outside Area | Goals Open Play | Goals from Corners | Goals from Throws | Goals from Direct Free Kick | Goals from Set Play | Goals from penalties | Attempts Open Play on target | Attempts from Corners on target | Attempts from Throws on target | Attempts from Direct Free Kick on target | Attempts from Set Play on target | Attempts from Penalties on target | Attempts Open Play off target | Attempts from Corners off target | Attempts from Throws off target | Attempts from Direct Free Kick off target | Attempts from Set Play off target | Attempts from Penalties off target | Goals as a substitute | Total Successful Passes All | Total Unsuccessful Passes All | Assists | Key Passes | Total Successful Passes Excl Crosses Corners | Total Unsuccessful Passes Excl Crosses Corners | Successful Passes Own Half | Unsuccessful Passes Own Half | Successful Passes Opposition Half | Unsuccessful Passes Opposition Half | Successful Passes Defensive third | Unsuccessful Passes Defensive third | Successful Passes Middle third | Unsuccessful Passes Middle third | Successful Passes Final third | Unsuccessful Passes Final third | Successful Short Passes | Unsuccessful Short Passes | Successful Long Passes | Unsuccessful Long Passes | Successful Flick-Ons | Unsuccessful Flick-Ons | Successful Crosses Corners | Unsuccessful Crosses Corners | Corners Taken incl short corners | Corners Conceded | Successful Corners into Box | Unsuccessful Corners into Box | Short Corners | Throw Ins to Own Player | Throw Ins to Opposition Player | Successful Dribbles | Unsuccessful Dribbles | Successful Crosses Corners Left | Unsuccessful Crosses Corners Left | Successful Crosses Left | Unsuccessful Crosses Left | Successful Corners Left | Unsuccessful Corners Left | Successful Crosses Corners Right | Unsuccessful Crosses Corners Right | Successful Crosses Right | Unsuccessful Crosses Right | Successful Corners Right | Unsuccessful Corners Right | Successful Long Balls | Unsuccessful Long Balls | Successful Lay-Offs | Unsuccessful Lay-Offs | Through Ball | Successful Crosses Corners in the air | Unsuccessful Crosses Corners in the air | Successful crosses in the air | Unsuccessful crosses in the air | Successful open play crosses | Unsuccessful open play crosses | Touches | Goal Assist Corner | Goal Assist Free Kick | Goal Assist Throw In | Goal Assist Goal Kick | Goal Assist Set Piece | Key Corner | Key Free Kick | Key Throw In | Key Goal Kick | Key Set Pieces | Duels won | Duels lost | Aerial Duels won | Aerial Duels lost | Ground Duels won | Ground Duels lost | Tackles Won | Tackles Lost | Last Man Tackle | Total Clearances | Headed Clearances | Other Clearances | Clearances Off the Line | Blocks | Interceptions | Recoveries | Total Fouls Conceded | Fouls Conceded exc handballs pens | Total Fouls Won | Fouls Won in Danger Area inc pens | Fouls Won not in danger area | Foul Won Penalty | Handballs Conceded | Penalties Conceded | Offsides | Yellow Cards | Red Cards | Goals Conceded | Goals Conceded Inside Box | Goals Conceded Outside Box | Saves Made | Saves Made from Inside Box | Saves Made from Outside Box | Saves from Penalty | Catches | Punches | Drops | Crosses not Claimed | GK Distribution | GK Successful Distribution | GK Unsuccessful Distribution | Clean Sheets | Team Clean sheet | Error leading to Goal | Error leading to Attempt | Challenge Lost | Shots On Conceded | Shots On Conceded Inside Box | Shots On Conceded Outside Box | Team Formation | Position in Formation | Turnovers | Dispossessed | Big Chances | Big Chances Faced | Pass Forward | Pass Backward | Pass Left | Pass Right | Unsuccessful Ball Touch | Successful Ball Touch | Take-Ons Overrun | CompId | SeasId | Touches open play final third | Touches open play opp box | Touches open play opp six yards | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 2012-04-28 | 28566 | Abou Diaby | Vassiriki | Arsenal | 3 | Stoke City | 110 | Away | 4 | 1 | 17 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 1 | 0 | 0 | 10 | 1 | 2 | 0 | 8 | 1 | 0 | 0 | 7 | 0 | 3 | 1 | 10 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 17 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 | 5 | 1 | 0 | 2 | 5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 1 | 17 | 3 | 8 | 3 | 24 | 6 | 6 | 1 | 0 | 0 | 0 | 4 | 3 | 0 | 0 | 1 | 2 | 2 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 0 | 3 | 0 | 1 | 0 | 0 | 3 | 0 | 0 | 0 | 4 | 0 | 3 | 0 | 3 | 53 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 | 5 | 0 | 0 | 3 | 5 | 0 | 0 | 0 | 2 | 2 | 0 | 0 | 0 | 0 | 5 | 3 | 3 | 2 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 | 10 | 0 | 2 | 0 | 0 | 6 | 10 | 13 | 12 | 0 | 4 | 0 | 8 | 2011 | 16 | 3 | 0 |
# Display the last 5 rows of the raw DataFrame, df_opta_mbm_raw
df_opta_mbm_raw.tail()
Date | Player ID | Player Surname | Player Forename | Team | Team Id | Opposition | Opposition id | Venue | Position Id | Appearances | Time Played | Starts | Substitute On | Substitute Off | Goals | First Goal | Winning Goal | Shots On Target inc goals | Shots Off Target inc woodwork | Blocked Shots | Penalties Taken | Penalty Goals | Penalties Saved | Penalties Off Target | Penalties Not Scored | Direct Free-kick Goals | Direct Free-kick On Target | Direct Free-kick Off Target | Blocked Direct Free-kick | Goals from Inside Box | Shots On from Inside Box | Shots Off from Inside Box | Blocked Shots from Inside Box | Goals from Outside Box | Shots On Target Outside Box | Shots Off Target Outside Box | Blocked Shots Outside Box | Headed Goals | Headed Shots On Target | Headed Shots Off Target | Headed Blocked Shots | Left Foot Goals | Left Foot Shots On Target | Left Foot Shots Off Target | Left Foot Blocked Shots | Right Foot Goals | Right Foot Shots On Target | Right Foot Shots Off Target | Right Foot Blocked Shots | Other Goals | Other Shots On Target | Other Shots Off Target | Other Blocked Shots | Shots Cleared off Line | Shots Cleared off Line Inside Area | Shots Cleared off Line Outside Area | Goals Open Play | Goals from Corners | Goals from Throws | Goals from Direct Free Kick | Goals from Set Play | Goals from penalties | Attempts Open Play on target | Attempts from Corners on target | Attempts from Throws on target | Attempts from Direct Free Kick on target | Attempts from Set Play on target | Attempts from Penalties on target | Attempts Open Play off target | Attempts from Corners off target | Attempts from Throws off target | Attempts from Direct Free Kick off target | Attempts from Set Play off target | Attempts from Penalties off target | Goals as a substitute | Total Successful Passes All | Total Unsuccessful Passes All | Assists | Key Passes | Total Successful Passes Excl Crosses Corners | Total Unsuccessful Passes Excl Crosses Corners | Successful Passes Own Half | Unsuccessful Passes Own Half | Successful Passes Opposition Half | Unsuccessful Passes Opposition Half | Successful Passes Defensive third | Unsuccessful Passes Defensive third | Successful Passes Middle third | Unsuccessful Passes Middle third | Successful Passes Final third | Unsuccessful Passes Final third | Successful Short Passes | Unsuccessful Short Passes | Successful Long Passes | Unsuccessful Long Passes | Successful Flick-Ons | Unsuccessful Flick-Ons | Successful Crosses Corners | Unsuccessful Crosses Corners | Corners Taken incl short corners | Corners Conceded | Successful Corners into Box | Unsuccessful Corners into Box | Short Corners | Throw Ins to Own Player | Throw Ins to Opposition Player | Successful Dribbles | Unsuccessful Dribbles | Successful Crosses Corners Left | Unsuccessful Crosses Corners Left | Successful Crosses Left | Unsuccessful Crosses Left | Successful Corners Left | Unsuccessful Corners Left | Successful Crosses Corners Right | Unsuccessful Crosses Corners Right | Successful Crosses Right | Unsuccessful Crosses Right | Successful Corners Right | Unsuccessful Corners Right | Successful Long Balls | Unsuccessful Long Balls | Successful Lay-Offs | Unsuccessful Lay-Offs | Through Ball | Successful Crosses Corners in the air | Unsuccessful Crosses Corners in the air | Successful crosses in the air | Unsuccessful crosses in the air | Successful open play crosses | Unsuccessful open play crosses | Touches | Goal Assist Corner | Goal Assist Free Kick | Goal Assist Throw In | Goal Assist Goal Kick | Goal Assist Set Piece | Key Corner | Key Free Kick | Key Throw In | Key Goal Kick | Key Set Pieces | Duels won | Duels lost | Aerial Duels won | Aerial Duels lost | Ground Duels won | Ground Duels lost | Tackles Won | Tackles Lost | Last Man Tackle | Total Clearances | Headed Clearances | Other Clearances | Clearances Off the Line | Blocks | Interceptions | Recoveries | Total Fouls Conceded | Fouls Conceded exc handballs pens | Total Fouls Won | Fouls Won in Danger Area inc pens | Fouls Won not in danger area | Foul Won Penalty | Handballs Conceded | Penalties Conceded | Offsides | Yellow Cards | Red Cards | Goals Conceded | Goals Conceded Inside Box | Goals Conceded Outside Box | Saves Made | Saves Made from Inside Box | Saves Made from Outside Box | Saves from Penalty | Catches | Punches | Drops | Crosses not Claimed | GK Distribution | GK Successful Distribution | GK Unsuccessful Distribution | Clean Sheets | Team Clean sheet | Error leading to Goal | Error leading to Attempt | Challenge Lost | Shots On Conceded | Shots On Conceded Inside Box | Shots On Conceded Outside Box | Team Formation | Position in Formation | Turnovers | Dispossessed | Big Chances | Big Chances Faced | Pass Forward | Pass Backward | Pass Left | Pass Right | Unsuccessful Ball Touch | Successful Ball Touch | Take-Ons Overrun | CompId | SeasId | Touches open play final third | Touches open play opp box | Touches open play opp six yards | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
10364 | 2011-10-23 | 4611 | van der Vaart | Rafael | Tottenham Hotspur | 6 | Blackburn Rovers | 5 | Away | 4 | 1 | 88 | 1 | 0 | 1 | 2 | 1 | 1 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 34 | 9 | 0 | 2 | 34 | 3 | 16 | 0 | 18 | 3 | 4 | 0 | 21 | 1 | 9 | 2 | 32 | 3 | 2 | 0 | 0 | 0 | 0 | 6 | 5 | 0 | 0 | 4 | 1 | 2 | 0 | 0 | 0 | 0 | 3 | 0 | 1 | 0 | 2 | 0 | 3 | 0 | 1 | 0 | 2 | 0 | 0 | 3 | 0 | 1 | 0 | 6 | 0 | 2 | 0 | 2 | 54 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 | 5 | 0 | 3 | 3 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 5 | 0 | 0 | 3 | 0 | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 6 | 10 | 0 | 1 | 1 | 0 | 8 | 12 | 10 | 13 | 3 | 1 | 0 | 8 | 2011 | 16 | 1 | 0 |
10365 | 2012-01-22 | 4611 | van der Vaart | Rafael | Tottenham Hotspur | 6 | Manchester City | 43 | Away | 4 | 1 | 68 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |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| 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 10 | 0 | 0 | 0 | 0 | 7 | 4 | 7 | 11 | 1 | 0 | 0 | 8 | 2011 | 12 | 1 | 0 |
# Print the shape of the raw DataFrame, df_opta_mbm_raw
print(df_opta_mbm_raw.shape)
(10369, 210)
# Print the column names of the raw DataFrame, df_opta_mbm_raw
print(df_opta_mbm_raw.columns)
Index(['Date', 'Player ID', 'Player Surname', 'Player Forename', 'Team', 'Team Id', 'Opposition', 'Opposition id', 'Venue', 'Position Id', ... 'Pass Left', 'Pass Right', 'Unsuccessful Ball Touch', 'Successful Ball Touch', 'Take-Ons Overrun', 'CompId', 'SeasId', 'Touches open play final third', 'Touches open play opp box', 'Touches open play opp six yards'], dtype='object', length=210)
The dataset has two hundred and ten features (columns). Full details of these attributes can be found in the Data Dictionary.
# Data types of the features of the raw DataFrame, df_opta_mbm_raw
df_opta_mbm_raw.dtypes
Date object Player ID int64 Player Surname object Player Forename object Team object ... CompId int64 SeasId int64 Touches open play final third int64 Touches open play opp box int64 Touches open play opp six yards int64 Length: 210, dtype: object
All six of the columns have the object data type. Full details of these attributes and their data types can be found in the Data Dictionary.
# Info for the raw DataFrame, df_opta_mbm_raw
df_opta_mbm_raw.info()
<class 'pandas.core.frame.DataFrame'> RangeIndex: 10369 entries, 0 to 10368 Columns: 210 entries, Date to Touches open play opp six yards dtypes: int64(204), object(6) memory usage: 16.6+ MB
# Description of the raw DataFrame, df_sb_raw, showing some summary statistics for each numberical column in the DataFrame
df_opta_mbm_raw.describe()
Player ID | Team Id | Opposition id | Position Id | Appearances | Time Played | Starts | Substitute On | Substitute Off | Goals | First Goal | Winning Goal | Shots On Target inc goals | Shots Off Target inc woodwork | Blocked Shots | Penalties Taken | Penalty Goals | Penalties Saved | Penalties Off Target | Penalties Not Scored | Direct Free-kick Goals | Direct Free-kick On Target | Direct Free-kick Off Target | Blocked Direct Free-kick | Goals from Inside Box | Shots On from Inside Box | Shots Off from Inside Box | Blocked Shots from Inside Box | Goals from Outside Box | Shots On Target Outside Box | Shots Off Target Outside Box | Blocked Shots Outside Box | Headed Goals | Headed Shots On Target | Headed Shots Off Target | Headed Blocked Shots | Left Foot Goals | Left Foot Shots On Target | Left Foot Shots Off Target | Left Foot Blocked Shots | Right Foot Goals | Right Foot Shots On Target | Right Foot Shots Off Target | Right Foot Blocked Shots | Other Goals | Other Shots On Target | Other Shots Off Target | Other Blocked Shots | Shots Cleared off Line | Shots Cleared off Line Inside Area | Shots Cleared off Line Outside Area | Goals Open Play | Goals from Corners | Goals from Throws | Goals from Direct Free Kick | Goals from Set Play | Goals from penalties | Attempts Open Play on target | Attempts from Corners on target | Attempts from Throws on target | Attempts from Direct Free Kick on target | Attempts from Set Play on target | Attempts from Penalties on target | Attempts Open Play off target | Attempts from Corners off target | Attempts from Throws off target | Attempts from Direct Free Kick off target | Attempts from Set Play off target | Attempts from Penalties off target | Goals as a substitute | Total Successful Passes All | Total Unsuccessful Passes All | Assists | Key Passes | Total Successful Passes Excl Crosses Corners | Total Unsuccessful Passes Excl Crosses Corners | Successful Passes Own Half | Unsuccessful Passes Own Half | Successful Passes Opposition Half | Unsuccessful Passes Opposition Half | Successful Passes Defensive third | Unsuccessful Passes Defensive third | Successful Passes Middle third | Unsuccessful Passes Middle third | Successful Passes Final third | Unsuccessful Passes Final third | Successful Short Passes | Unsuccessful Short Passes | Successful Long Passes | Unsuccessful Long Passes | Successful Flick-Ons | Unsuccessful Flick-Ons | Successful Crosses Corners | Unsuccessful Crosses Corners | Corners Taken incl short corners | Corners Conceded | Successful Corners into Box | Unsuccessful Corners into Box | Short Corners | Throw Ins to Own Player | Throw Ins to Opposition Player | Successful Dribbles | Unsuccessful Dribbles | Successful Crosses Corners Left | Unsuccessful Crosses Corners Left | Successful Crosses Left | Unsuccessful Crosses Left | Successful Corners Left | Unsuccessful Corners Left | Successful Crosses Corners Right | Unsuccessful Crosses Corners Right | Successful Crosses Right | Unsuccessful Crosses Right | Successful Corners Right | Unsuccessful Corners Right | Successful Long Balls | Unsuccessful Long Balls | Successful Lay-Offs | Unsuccessful Lay-Offs | Through Ball | Successful Crosses Corners in the air | Unsuccessful Crosses Corners in the air | Successful crosses in the air | Unsuccessful crosses in the air | Successful open play crosses | Unsuccessful open play crosses | Touches | Goal Assist Corner | Goal Assist Free Kick | Goal Assist Throw In | Goal Assist Goal Kick | Goal Assist Set Piece | Key Corner | Key Free Kick | Key Throw In | Key Goal Kick | Key Set Pieces | Duels won | Duels lost | Aerial Duels won | Aerial Duels lost | Ground Duels won | Ground Duels lost | Tackles Won | Tackles Lost | Last Man Tackle | Total Clearances | Headed Clearances | Other Clearances | Clearances Off the Line | Blocks | Interceptions | Recoveries | Total Fouls Conceded | Fouls Conceded exc handballs pens | Total Fouls Won | Fouls Won in Danger Area inc pens | Fouls Won not in danger area | Foul Won Penalty | Handballs Conceded | Penalties Conceded | Offsides | Yellow Cards | Red Cards | Goals Conceded | Goals Conceded Inside Box | Goals Conceded Outside Box | Saves Made | Saves Made from Inside Box | Saves Made from Outside Box | Saves from Penalty | Catches | Punches | Drops | Crosses not Claimed | GK Distribution | GK Successful Distribution | GK Unsuccessful Distribution | Clean Sheets | Team Clean sheet | Error leading to Goal | Error leading to Attempt | Challenge Lost | Shots On Conceded | Shots On Conceded Inside Box | Shots On Conceded Outside Box | Team Formation | Position in Formation | Turnovers | Dispossessed | Big Chances | Big Chances Faced | Pass Forward | Pass Backward | Pass Left | Pass Right | Unsuccessful Ball Touch | Successful Ball Touch | Take-Ons Overrun | CompId | SeasId | Touches open play final third | Touches open play opp box | Touches open play opp six yards | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
count | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.0 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.00000 | 10369.0 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.0 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.0 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.0 | 10369.0 | 10369.000000 | 10369.000000 | 10369.000000 |
mean | 25662.119684 | 35.688012 | 35.774617 | 3.543061 | 1.0 | 72.366091 | 0.806249 | 0.193751 | 0.193751 | 0.098852 | 0.034044 | 0.026714 | 0.339666 | 0.430803 | 0.279873 | 0.009644 | 0.006944 | 0.002218 | 0.000482 | 0.002700 | 0.002797 | 0.013695 | 0.018999 | 0.020638 | 0.081782 | 0.223551 | 0.236378 | 0.124699 | 0.017070 | 0.116115 | 0.194426 | 0.155174 | 0.017649 | 0.055454 | 0.096152 | 0.018902 | 0.028450 | 0.106664 | 0.131450 | 0.103964 | 0.051885 | 0.176391 | 0.202237 | 0.156910 | 0.000868 | 0.001157 | 0.000964 | 0.000096 | 0.011477 | 0.010994 | 0.000482 | 0.069824 | 0.012441 | 0.001929 | 0.002797 | 0.006365 | 0.006944 | 0.241007 | 0.036358 | 0.006462 | 0.013695 | 0.017359 | 0.009162 | 0.290963 | 0.072813 | 0.011284 | 0.018999 | 0.025461 | 0.000482 | 0.010512 | 25.971357 | 7.963159 | 0.070306 | 0.714341 | 24.937217 | 6.370335 | 11.376121 | 1.361558 | 13.561096 | 5.008776 | 4.719549 | 0.356254 | 13.616356 | 2.603048 | 6.601312 | 3.411033 | 22.717716 | 4.565918 | 2.219500 | 1.804417 | 0.193847 | 0.432539 | 0.378436 | 1.236281 | 0.416723 | 0.417784 | 0.112161 | 0.224998 | 0.063941 | 1.306973 | 0.321439 | 0.476131 | 0.604012 | 0.178031 | 0.585109 | 0.124409 | 0.475070 | 0.053621 | 0.110040 | 0.194426 | 0.645289 | 0.135404 | 0.530041 | 0.059022 | 0.115247 | 0.559553 | 1.354229 | 1.187096 | 0.086508 | 0.067509 | 0.344585 | 1.092873 | 0.233484 | 0.870672 | 0.256630 | 1.005111 | 46.192111 | 0.009065 | 0.004822 | 0.00164 | 0.0 | 0.015527 | 0.072717 | 0.029029 | 0.007040 | 0.000482 | 0.109268 | 3.388659 | 3.504581 | 0.774327 | 0.774327 | 2.614331 | 2.730254 | 1.028354 | 0.352204 | 0.012827 | 2.175234 | 1.108689 | 1.066545 | 0.011380 | 0.268493 | 1.170701 | 6.719645 | 0.798438 | 0.747902 | 0.756679 | 0.185650 | 0.571029 | 0.008776 | 0.041759 | 0.009644 | 0.163179 | 0.111293 | 0.006365 | 0.102806 | 0.085736 | 0.017070 | 0.229337 | 0.130774 | 0.098563 | 0.002218 | 0.093355 | 0.039927 | 0.008101 | 0.006365 | 1.012248 | 0.655705 | 0.356544 | 0.019867 | 0.0 | 0.013984 | 0.015045 | 0.476034 | 0.343620 | 0.227505 | 0.116115 | 4.858810 | 7.704504 | 0.0 | 0.893529 | 0.131160 | 0.131160 | 12.386826 | 4.787829 | 8.344874 | 8.414987 | 0.864500 | 0.771048 | 0.115826 | 8.0 | 2011.0 | 10.300415 | 1.463786 | 0.107629 |
std | 20790.034876 | 33.297585 | 33.311032 | 1.581414 | 0.0 | 28.596946 | 0.395255 | 0.395255 | 0.395255 | 0.343547 | 0.181350 | 0.161255 | 0.703668 | 0.754654 | 0.588913 | 0.100652 | 0.084197 | 0.047047 | 0.021955 | 0.051897 | 0.054609 | 0.122685 | 0.142067 | 0.146191 | 0.310355 | 0.557791 | 0.556045 | 0.378299 | 0.132484 | 0.373737 | 0.476901 | 0.429134 | 0.135290 | 0.249829 | 0.344032 | 0.139684 | 0.171966 | 0.373716 | 0.401078 | 0.355719 | 0.243766 | 0.491476 | 0.506222 | 0.436751 | 0.029450 | 0.034001 | 0.031042 | 0.009820 | 0.107419 | 0.105202 | 0.021955 | 0.286907 | 0.113429 | 0.043878 | 0.054609 | 0.079531 | 0.084197 | 0.577912 | 0.196736 | 0.082500 | 0.122685 | 0.131349 | 0.098273 | 0.614037 | 0.286668 | 0.107439 | 0.142067 | 0.161159 | 0.021955 | 0.105708 | 17.854129 | 5.393289 | 0.278081 | 1.092018 | 18.042517 | 4.287731 | 10.298305 | 1.516356 | 10.923421 | 3.670587 | 4.940019 | 0.667245 | 11.270300 | 2.304931 | 6.038887 | 2.806933 | 16.976651 | 3.511626 | 2.750183 | 2.955452 | 0.579881 | 1.101918 | 0.865748 | 2.071939 | 1.294514 | 0.782609 | 0.471052 | 0.782234 | 0.318023 | 2.879792 | 1.026728 | 0.897868 | 1.082000 | 0.551667 | 1.354759 | 0.432958 | 1.138033 | 0.287367 | 0.487443 | 0.584988 | 1.370692 | 0.445083 | 1.179284 | 0.323029 | 0.505304 | 1.439410 | 2.470269 | 1.874924 | 0.330340 | 0.280326 | 0.820961 | 1.912071 | 0.585622 | 1.489792 | 0.615836 | 1.646309 | 24.211531 | 0.096799 | 0.069277 | 0.04046 | 0.0 | 0.125193 | 0.333792 | 0.179554 | 0.095463 | 0.021955 | 0.417268 | 2.775550 | 2.968456 | 1.323165 | 1.235718 | 2.351835 | 2.505136 | 1.277690 | 0.660982 | 0.117562 | 3.276374 | 2.025839 | 1.660291 | 0.106979 | 0.621481 | 1.447242 | 4.676845 | 1.021978 | 0.985476 | 1.017644 | 0.475035 | 0.844939 | 0.094302 | 0.209929 | 0.097735 | 0.525938 | 0.314510 | 0.079531 | 0.503116 | 0.434434 | 0.147634 | 0.991118 | 0.625514 | 0.492348 | 0.047047 | 0.472593 | 0.267062 | 0.097875 | 0.085380 | 3.758933 | 2.535186 | 1.491775 | 0.139550 | 0.0 | 0.119869 | 0.122527 | 0.812369 | 1.412394 | 0.990421 | 0.556613 | 2.515103 | 4.569704 | 0.0 | 1.250866 | 0.428717 | 0.645917 | 9.273106 | 4.134100 | 7.870851 | 7.859229 | 1.216473 | 1.024039 | 0.378315 | 0.0 | 0.0 | 9.803810 | 2.115097 | 0.362961 |
min | 3.000000 | 1.000000 | 1.000000 | 1.000000 | 1.0 | 1.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.00000 | 0.0 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.0 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 2.000000 | 1.000000 | 0.0 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 8.0 | 2011.0 | 0.000000 | 0.000000 | 0.000000 |
25% | 10561.000000 | 7.000000 | 6.000000 | 2.000000 | 1.0 | 65.000000 | 1.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 13.000000 | 4.000000 | 0.000000 | 0.000000 | 11.000000 | 3.000000 | 4.000000 | 0.000000 | 5.000000 | 2.000000 | 1.000000 | 0.000000 | 5.000000 | 1.000000 | 2.000000 | 1.000000 | 10.000000 | 2.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 30.000000 | 0.000000 | 0.000000 | 0.00000 | 0.0 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 1.000000 | 1.000000 | 0.000000 | 0.000000 | 1.000000 | 1.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 3.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.0 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 2.000000 | 4.000000 | 0.0 | 0.000000 | 0.000000 | 0.000000 | 5.000000 | 1.000000 | 2.000000 | 2.000000 | 0.000000 | 0.000000 | 0.000000 | 8.0 | 2011.0 | 2.000000 | 0.000000 | 0.000000 |
50% | 19188.000000 | 30.000000 | 35.000000 | 4.000000 | 1.0 | 90.000000 | 1.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 23.000000 | 7.000000 | 0.000000 | 0.000000 | 21.000000 | 6.000000 | 9.000000 | 1.000000 | 11.000000 | 4.000000 | 3.000000 | 0.000000 | 11.000000 | 2.000000 | 5.000000 | 3.000000 | 20.000000 | 4.000000 | 1.000000 | 1.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 46.000000 | 0.000000 | 0.000000 | 0.00000 | 0.0 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 3.000000 | 3.000000 | 0.000000 | 0.000000 | 2.000000 | 2.000000 | 1.000000 | 0.000000 | 0.000000 | 1.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 1.000000 | 6.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.0 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 5.000000 | 7.000000 | 0.0 | 0.000000 | 0.000000 | 0.000000 | 11.000000 | 4.000000 | 6.000000 | 6.000000 | 0.000000 | 0.000000 | 0.000000 | 8.0 | 2011.0 | 8.000000 | 1.000000 | 0.000000 |
75% | 39765.000000 | 52.000000 | 54.000000 | 4.000000 | 1.0 | 90.000000 | 1.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 1.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 36.000000 | 11.000000 | 0.000000 | 1.000000 | 35.000000 | 9.000000 | 16.000000 | 2.000000 | 19.000000 | 7.000000 | 7.000000 | 1.000000 | 19.000000 | 4.000000 | 10.000000 | 5.000000 | 32.000000 | 7.000000 | 3.000000 | 2.000000 | 0.000000 | 0.000000 | 0.000000 | 2.000000 | 0.000000 | 1.000000 | 0.000000 | 0.000000 | 0.000000 | 1.000000 | 0.000000 | 1.000000 | 1.000000 | 0.000000 | 1.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 1.000000 | 0.000000 | 1.000000 | 0.000000 | 0.000000 | 0.000000 | 2.000000 | 2.000000 | 0.000000 | 0.000000 | 0.000000 | 1.000000 | 0.000000 | 1.000000 | 0.000000 | 1.000000 | 62.000000 | 0.000000 | 0.000000 | 0.00000 | 0.0 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 5.000000 | 5.000000 | 1.000000 | 1.000000 | 4.000000 | 4.000000 | 2.000000 | 1.000000 | 0.000000 | 3.000000 | 1.000000 | 2.000000 | 0.000000 | 0.000000 | 2.000000 | 10.000000 | 1.000000 | 1.000000 | 1.000000 | 0.000000 | 1.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.0 | 0.000000 | 0.000000 | 1.000000 | 0.000000 | 0.000000 | 0.000000 | 6.000000 | 11.000000 | 0.0 | 1.000000 | 0.000000 | 0.000000 | 18.000000 | 7.000000 | 12.000000 | 12.000000 | 1.000000 | 1.000000 | 0.000000 | 8.0 | 2011.0 | 16.000000 | 2.000000 | 0.000000 |
max | 114042.000000 | 111.000000 | 111.000000 | 6.000000 | 1.0 | 90.000000 | 1.000000 | 1.000000 | 1.000000 | 4.000000 | 1.000000 | 1.000000 | 9.000000 | 6.000000 | 5.000000 | 2.000000 | 2.000000 | 1.000000 | 1.000000 | 1.000000 | 2.000000 | 2.000000 | 2.000000 | 2.000000 | 4.000000 | 7.000000 | 6.000000 | 5.000000 | 2.000000 | 5.000000 | 4.000000 | 4.000000 | 2.000000 | 3.000000 | 5.000000 | 2.000000 | 2.000000 | 5.000000 | 4.000000 | 5.000000 | 3.000000 | 8.000000 | 5.000000 | 4.000000 | 1.000000 | 1.000000 | 1.000000 | 1.000000 | 2.000000 | 2.000000 | 1.000000 | 4.000000 | 2.000000 | 1.000000 | 2.000000 | 1.000000 | 2.000000 | 7.000000 | 2.000000 | 2.000000 | 2.000000 | 2.000000 | 2.000000 | 5.000000 | 4.000000 | 2.000000 | 2.000000 | 2.000000 | 1.000000 | 2.000000 | 157.000000 | 38.000000 | 4.000000 | 9.000000 | 157.000000 | 31.000000 | 77.000000 | 12.000000 | 106.000000 | 28.000000 | 48.000000 | 6.000000 | 117.000000 | 17.000000 | 58.000000 | 22.000000 | 156.000000 | 24.000000 | 26.000000 | 30.000000 | 10.000000 | 13.000000 | 9.000000 | 22.000000 | 16.000000 | 7.000000 | 5.000000 | 13.000000 | 6.000000 | 22.000000 | 12.000000 | 9.000000 | 11.000000 | 7.000000 | 16.000000 | 6.000000 | 13.000000 | 4.000000 | 7.000000 | 7.000000 | 15.000000 | 5.000000 | 14.000000 | 5.000000 | 9.000000 | 22.000000 | 25.000000 | 18.000000 | 4.000000 | 3.000000 | 8.000000 | 22.000000 | 6.000000 | 13.000000 | 6.000000 | 14.000000 | 175.000000 | 2.000000 | 1.000000 | 1.00000 | 0.0 | 2.000000 | 5.000000 | 3.000000 | 4.000000 | 1.000000 | 5.000000 | 19.000000 | 20.000000 | 15.000000 | 12.000000 | 17.000000 | 18.000000 | 11.000000 | 6.000000 | 2.000000 | 25.000000 | 17.000000 | 12.000000 | 2.000000 | 8.000000 | 12.000000 | 26.000000 | 8.000000 | 8.000000 | 8.000000 | 4.000000 | 7.000000 | 2.000000 | 3.000000 | 1.000000 | 6.000000 | 1.000000 | 1.000000 | 8.000000 | 6.000000 | 3.000000 | 12.000000 | 10.000000 | 8.000000 | 1.000000 | 8.000000 | 5.000000 | 3.000000 | 3.000000 | 26.000000 | 22.000000 | 16.000000 | 1.000000 | 0.0 | 2.000000 | 2.000000 | 9.000000 | 15.000000 | 13.000000 | 8.000000 | 17.000000 | 18.000000 | 0.0 | 9.000000 | 6.000000 | 9.000000 | 54.000000 | 29.000000 | 66.000000 | 67.000000 | 9.000000 | 9.000000 | 5.000000 | 8.0 | 2011.0 | 78.000000 | 21.000000 | 4.000000 |
# Plot visualisation of the missing values for each feature of the raw DataFrame, df_opta_mbm_raw
msno.matrix(df_opta_mbm_raw, figsize = (30, 7))
<matplotlib.axes._subplots.AxesSubplot at 0x1a1b68b350>
# Counts of missing values
opta_null_value_stats = df_opta_mbm_raw.isnull().sum(axis=0)
opta_null_value_stats[opta_null_value_stats != 0]
Player Forename 863 dtype: int64
The visualisation shows us that the only field with missing values is the Player Forename
attribute. This is something that will be fixed in the Data Engineering section.
The Opta dataset has one hundred and fourteen features (columns) with the following definitions and data types:
id | name | 1 | 0 | |
---|---|---|---|---|
1 | Pass |
a successful pass ie the pass accurately made it from one player to another without any interception | an unsuccessful pass ie the pass is wayward and does not make it to the other player or is intercepted | |
2 | Offside Pass |
nan | nan | |
3 | Take On |
a player successfully dribbling the ball past the opponent and retaining possession afterwards | a player attempting to dribble past an opposing but being unsuccessful eg tackled or losing possession | |
4 | Free kick |
the player who was fouled ie the player who 'won' the foul | the player who committed the foul | |
5 | Out |
the team that gains possession by virtue of the opposite team putting the ball out of play | the team & player that gave away possession of the ball by being the last player to touch the ball before it went out of play | |
6 | Corner |
the team that wins the corner by virtue of the opposite team putting the ball out of play | the team & player that gave away possession of the ball by being the last player to touch the ball before it went out of play | |
7 | Tackle |
the tackling player both winning the tackle and then retaining possession of the ball afterwards (or the ball goes out of play) | the tackling player winning the tackle but not gaining possession of the ball | |
8 | Interception |
nan | nan | |
9 | Turnover |
nan | nan | |
10 | Save |
a successful save ie the shot was prevented from going into the goal | an unsuccessful save ie the shot led to a goal | |
11 | Claim |
a successful catch by the goalkeeper | an unsuccessful catch ie the ball was dropped or fumbled | |
12 | Clearance |
a clearance resulting in the team keeping possession of the ball | a clearance where the team lose possession of the ball | |
13 | Miss |
nan | nan | |
14 | Post |
nan | nan | |
15 | Attempt Saved |
nan | nan | |
16 | Goal |
nan | nan | |
17 | Card |
nan | nan | |
18 | Player off |
nan | nan | |
19 | Player on |
nan | nan | |
20 | Player retired |
nan | nan | |
21 | Player returns |
nan | nan | |
22 | Player becomes goalkeeper |
nan | nan | |
23 | Goalkeeper becomes player |
nan | nan | |
24 | Condition change |
nan | nan | |
25 | Official change |
nan | nan | |
26 | Possession |
nan | nan | |
27 | Start delay |
nan | nan | |
28 | End delay |
nan | nan | |
29 | Temporary stop |
nan | nan | |
30 | End |
nan | nan | |
31 | Picked an orange |
nan | nan | |
32 | Start |
nan | nan | |
33 | Start/End canceling |
nan | nan | |
34 | Team set up |
nan | nan | |
35 | Player changed position |
nan | nan | |
36 | Player changed Jersey number |
nan | nan | |
37 | Collection End |
nan | nan | |
38 | Temp_Goal |
nan | nan | |
39 | Temp_Attempt |
nan | nan | |
40 | Formation change |
nan | nan | |
41 | Punch |
nan | nan | |
42 | Good skill |
nan | nan | |
43 | Deleted event |
nan | nan | |
44 | Aerial |
the player who successfully won the duel ie gained possession from it | the player who lost the duel ie did not win possession of the ball | |
45 | Challenge |
nan | nan | |
46 | Postponed |
nan | nan | |
47 | Rescinded card |
nan | nan | |
48 | Provisional lineup |
nan | nan | |
49 | Ball recovery |
nan | nan | |
50 | Dispossessed |
nan | nan | |
52 | Keeper pick-up |
nan | nan | |
53 | Cross not claimed |
nan | nan | |
54 | Smother |
nan | nan | |
55 | Offside provoked |
nan | nan | |
54 | 51 |
Error | nan | nan |
58 | Shot faced |
nan | nan | |
56 | Shield ball oop |
nan | nan | |
57 | Foul throw in |
nan | nan | |
59 | Keeper Sweeper |
nan | nan | |
62 | Event placeholder |
nan | nan | |
60 | Chance Missed |
the ball simply hit the player unintentionally | player unsuccessfully controlled the ball | |
61 | Ball touch |
the ball simply hit the player unintentionally | player unsuccessfully controlled the ball | |
63 | Temp_Save |
nan | nan | |
64 | Resume |
nan | nan |
For a full list of definitions, see the official documentation [link].
# Method 1: Open CSV prepared in R
#df_opta_events_raw = pd.read_excel(data_dir_opta + '/raw/events/' + 'events.csv')
See: https://fcpython.com/blog/parsing-opta-f24-files-introduction-xml-python
First import the XML file using the imported XML module.
The following two lines below will take an XML file and parse it into something that we could navigate just like we do with an object by using square brackets:
# Import XML file using XML module
tree = et.ElementTree(file=data_dir_opta + '/raw/events/' + 'Bolton_ManCityF24.xml')
gameFile = tree.getroot()
Next take a look at what information we are given about the game itself with the ‘.attrib’ method from the XML module imported earlier.
We get loads of information about the match in a dictionary, where the data is laid out with a key, then the value. For example, we can see the team names and also their Opta IDs.
gameFile[0].attrib
{'id': '360481', 'away_team_id': '43', 'away_team_name': 'Manchester City', 'competition_id': '8', 'competition_name': 'English Barclays Premier League', 'game_date': '2011-08-21T16:00:00', 'home_team_id': '30', 'home_team_name': 'Bolton Wanderers', 'matchday': '2', 'period_1_start': '2011-08-21T16:00:38', 'period_2_start': '2011-08-21T17:03:47', 'season_id': '2011', 'season_name': 'Season 2011/2012'}
Print the match details:
# Print a string with the two teams, using %s and the attrib to dynamically fill the string
print('{} vs {}'.format(gameFile[0].attrib['home_team_name'], gameFile[0].attrib['away_team_name']))
Bolton Wanderers vs Manchester City
Tthe structure of the file that the match events lie within the game details tags. The first event is the following:
gameFile[0][0].attrib
{'id': '301038339', 'event_id': '1', 'type_id': '34', 'period_id': '16', 'min': '0', 'sec': '0', 'team_id': '43', 'outcome': '1', 'x': '0.0', 'y': '0.0', 'timestamp': '2011-08-21T15:23:06.696', 'last_modified': '2011-08-21T15:54:56'}
We can see that there are event keys like min
, sec
, x
and y
– these are quite easy to understand.
The values, like outcome
: 1 and event_id
: 1, don’t really make much sense by themselves. This is particularly important when it comes to teams, as we only have their id
and not their name. This is tidied up in the next steps.
The Opta XML uses lots of IDs rather than names that are detailed in the Opta documentation link
# Import XLS file of aggregated performance data as a pandas DataFrame
df_opta_event_definitions = pd.read_excel(data_dir_opta + '/raw/' + 'Event Definitions - Excel file.xlsx')
# Display DataFrame
df_opta_event_definitions.head()
id | name | 1 | 0 | |
---|---|---|---|---|
0 | 1 | Pass | a successful pass ie the pass accurately made ... | an unsuccessful pass ie the pass is wayward an... |
1 | 2 | Offside Pass | NaN | NaN |
2 | 3 | Take On | a player successfully dribbling the ball past ... | a player attempting to dribble past an opposin... |
3 | 4 | Free kick | the player who was fouled ie the player who 'w... | the player who committed the foul |
4 | 5 | Out | the team that gains possession by virtue of th... | the team & player that gave away possession of... |
# Print DataFrame as Markdown
#print(df_opta_event_definitions.to_markdown())
The events contained qualifiers. Let’s again use square brackets to pull the first one out for the event above:
gameFile[0][0][0].attrib
{'id': '2028397186', 'qualifier_id': '130', 'value': '4'}
We are going to loop through each of the events that we have identified above and take the details that we want from each. These details will go into different lists for different data categories (player, team, success, etc.). We will then put these lists into a table which is then ready for analysis, plotting or exporting.
Firstly though, we'll make the team names come through to make this a bit more readible, while than the team ID. The events only carry the team ID, so let’s create a dictionary that will allow us to later swap the ID for the team name:
team_dict = {gameFile[0].attrib['home_team_id']: gameFile[0].attrib['home_team_name'],
gameFile[0].attrib['away_team_id']: gameFile[0].attrib['away_team_name']}
print(team_dict)
{'30': 'Bolton Wanderers', '43': 'Manchester City'}
For this tutorial, we’re simply going to take the x/y locations of the pass origin and destination, the time of the pass, the team and whether or not it was successful.
There’s so much more that we could take, such as the players, the pass length or any other details that you spot in the XML. If you’d like to pull those out too, doing so will make a great extension to this tutorial!
We’re going to start by creating the empty lists for our data:
#Create empty lists for the 8 columns we're collecting data for
x_origin = []
y_origin = []
x_destination = []
y_destination = []
outcome = []
minute = []
half = []
team = []
event_id = []
qualifier_id = []
type_id = []
ids = []
The main part of the tutorial sees us going event-by-event and adding our desired details only when the event is a pass. To do this, we will use a for loop on each event, and when the event is a pass (id = 1), we will append the correct attribute to our lists created above. Some of these details are hidden in the qualifiers, so we’ll also iterate over those to get the information needed there.
This tutorial probably isn’t the best place to go through the intricacies of the feed, so take a look at the docs if you’re interested.
Follow the code below with comments on each of the above steps:
gameFile[0][0].attrib
{'id': '301038339', 'event_id': '1', 'type_id': '34', 'period_id': '16', 'min': '0', 'sec': '0', 'team_id': '43', 'outcome': '1', 'x': '0.0', 'y': '0.0', 'timestamp': '2011-08-21T15:23:06.696', 'last_modified': '2011-08-21T15:54:56'}
# Iterate through each game in our file - we only have one
for game in gameFile:
# Iterate through each event
for event in game:
print(event.attrib.get("type_id"))
34 34 32 32 1 1 7 3 5 5 1 1 4 4 1 1 1 1 7 3 6 6 1 4 4 1 1 44 44 12 7 50 1 8 49 55 2 1 1 12 1 4 4 15 10 12 12 1 1 12 49 1 1 1 5 5 1 1 49 12 61 1 1 1 5 5 1 1 1 1 1 1 1 4 4 1 1 1 1 49 50 7 1 4 4 1 1 1 44 44 1 1 5 5 1 1 1 1 1 3 45 7 50 5 5 1 1 1 1 8 49 1 1 1 1 1 8 49 1 1 1 12 5 5 1 61 49 1 1 1 49 1 8 1 1 61 49 1 49 1 8 61 1 1 5 5 1 1 1 12 1 43 43 1 1 1 1 49 1 1 8 43 61 43 1 1 61 4 4 1 1 3 7 49 1 1 56 5 5 1 1 1 12 1 49 1 8 49 1 1 45 3 1 1 1 1 8 49 1 1 1 1 12 43 6 6 1 12 13 5 1 5 44 44 1 1 49 1 1 1 1 15 10 6 6 1 12 6 6 1 12 49 1 1 1 1 52 1 1 61 5 5 1 1 8 49 1 1 1 1 1 1 1 1 1 1 8 1 1 1 1 1 5 5 1 1 12 1 1 1 1 1 1 1 1 1 1 49 1 1 1 1 1 1 49 1 1 61 5 5 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 10 15 49 1 1 8 52 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 7 3 61 43 12 5 5 1 1 45 3 1 10 15 52 1 1 52 1 1 1 1 1 1 49 1 1 1 1 1 1 1 1 1 8 49 1 1 1 13 5 5 1 4 4 1 11 1 1 1 4 4 1 61 52 1 1 52 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 7 50 49 1 4 4 1 12 15 10 6 6 1 11 1 12 61 61 1 1 1 4 4 1 1 1 1 1 1 1 1 1 1 12 61 49 1 1 1 1 1 1 1 4 4 1 1 1 1 1 1 1 1 50 7 49 1 1 1 1 12 49 45 3 1 10 15 5 5 1 1 1 51 16 1 1 1 1 1 1 1 52 1 1 1 1 5 5 1 1 1 1 12 1 6 6 1 12 1 1 52 1 1 49 1 61 1 1 1 1 1 1 1 1 49 1 1 5 5 1 1 61 1 1 1 1 1 1 1 1 1 1 61 1 1 1 7 50 5 5 1 44 44 1 49 1 1 8 1 8 4 4 1 4 4 1 1 1 1 43 4 4 1 1 1 1 52 1 1 49 1 61 49 1 8 49 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 44 44 11 1 12 1 1 1 1 8 1 1 12 8 12 49 4 4 1 44 44 12 1 1 44 44 1 49 1 1 1 1 1 1 49 1 1 52 1 44 44 1 1 1 1 1 1 61 12 61 49 1 13 5 5 1 1 1 1 61 5 5 1 1 50 7 12 49 1 1 1 8 12 1 1 49 1 1 44 44 1 49 1 1 1 1 61 12 1 8 6 6 1 16 1 1 1 1 1 43 4 4 1 12 12 12 1 3 45 1 1 1 1 16 1 1 1 1 1 1 5 5 1 1 1 1 50 7 49 55 2 1 49 1 4 4 1 4 4 1 12 1 1 8 1 1 1 1 4 4 1 1 1 1 1 1 1 8 49 1 59 8 61 12 5 5 1 1 8 1 4 4 17 1 1 4 4 17 1 5 5 1 4 4 1 41 4 4 1 1 1 49 1 1 1 49 1 42 1 1 12 12 4 4 1 30 43 30 32 32 1 1 1 1 1 1 1 1 1 5 5 1 61 1 49 1 1 1 1 1 1 1 1 1 1 1 1 1 1 50 7 4 4 1 1 1 1 43 51 16 1 1 1 1 1 50 7 1 4 4 1 1 49 1 1 1 1 1 7 50 49 1 1 1 49 1 1 1 1 61 7 3 1 1 43 1 1 8 49 1 1 1 45 3 7 3 1 1 10 15 52 1 1 5 1 5 1 1 1 1 1 1 61 49 1 50 7 49 1 1 7 50 49 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 13 5 5 1 44 44 12 5 5 1 1 5 5 1 1 8 1 49 1 1 1 1 13 5 5 1 1 3 45 1 52 55 2 1 12 44 44 1 1 49 1 61 1 1 1 1 1 1 1 5 5 1 1 12 1 1 1 1 12 6 6 1 2 55 43 1 1 5 5 1 1 1 1 44 1 44 4 4 1 44 44 1 5 5 1 1 1 1 8 49 1 43 4 4 1 1 1 1 1 1 45 3 1 12 6 6 1 1 1 1 44 44 13 5 5 18 19 1 1 61 1 49 1 1 1 1 8 49 1 1 1 1 12 6 6 1 45 3 1 12 10 15 43 6 6 1 1 1 1 12 1 1 1 1 1 7 50 52 1 4 4 43 1 44 44 16 1 1 1 49 1 1 12 5 5 1 1 1 1 1 61 49 1 43 8 49 1 1 12 6 6 1 12 49 1 8 5 5 1 1 42 3 45 1 8 1 50 7 12 5 5 1 1 1 1 1 1 49 1 1 1 1 12 49 1 1 1 1 1 1 1 1 1 5 5 1 44 44 12 49 1 1 1 61 1 1 1 1 1 1 1 1 1 3 45 1 12 1 1 49 1 1 1 1 1 1 1 13 5 5 18 19 1 1 49 1 1 1 61 7 50 5 5 1 1 1 1 10 15 1 7 3 49 1 49 1 1 1 49 1 1 1 61 5 5 1 1 1 1 1 1 1 52 1 12 61 43 43 5 5 1 1 1 3 45 1 1 1 1 1 1 12 6 6 1 12 1 1 1 12 1 61 49 1 1 61 5 5 1 1 1 1 1 1 1 1 1 1 1 1 1 1 8 49 1 1 1 1 1 1 1 1 1 1 1 52 1 1 1 4 4 1 12 1 2 55 43 1 1 5 5 1 61 49 1 1 1 1 1 1 1 1 1 13 5 5 1 1 1 1 5 5 1 12 5 5 1 12 61 49 1 1 8 49 1 1 1 1 1 1 1 1 1 1 1 1 1 49 1 1 1 61 49 1 1 1 1 49 1 1 1 44 1 44 50 7 5 5 18 19 1 1 12 61 5 5 18 19 40 1 1 1 1 1 61 1 12 1 5 5 1 4 4 1 1 1 1 1 1 1 1 50 7 61 5 5 1 1 1 1 1 1 61 1 1 1 1 1 8 5 5 1 1 1 61 12 5 5 1 1 1 1 1 45 3 1 12 6 6 1 1 1 1 1 1 1 1 45 3 13 5 5 1 8 1 1 1 1 1 1 1 12 61 43 12 5 5 1 1 5 5 1 1 1 1 1 1 1 1 1 8 49 4 4 1 12 12 49 1 1 1 1 1 1 1 1 1 1 13 4 4 43 1 1 1 1 1 4 4 27 27 28 28 1 12 5 5 1 7 50 1 7 50 6 6 18 19 1 1 61 5 5 1 1 1 1 1 12 1 1 12 1 49 1 1 50 7 5 5 1 12 5 5 1 1 61 1 5 5 1 1 12 1 1 59 52 4 4 1 1 1 1 44 44 61 12 49 1 1 1 1 10 15 1 1 8 49 1 1 8 49 1 44 44 1 1 12 52 1 1 49 1 1 1 1 1 1 55 2 1 12 49 1 4 4 1 1 1 1 7 50 49 1 8 49 1 1 1 43 43 45 3 61 56 5 5 1 30 30 30 37 30 37
# Iterate through each game in our file - we only have one
for game in gameFile:
# Iterate through each event
for event in game:
# To the correct list, append the correct attribute using attrib.get()
ids.append(event.attrib.get("id"))
event_id.append(event.attrib.get("event_id"))
type_id.append(event.attrib.get("type_id"))
x_origin.append(event.attrib.get("x"))
y_origin.append(event.attrib.get("y"))
outcome.append(event.attrib.get("outcome"))
minute.append(event.attrib.get("min"))
half.append(event.attrib.get("period_id"))
team.append(team_dict[event.attrib.get("team_id")])
# Iterate through each qualifier
for qualifier in event:
qualifier_id.append(event.attrib.get("qualifier_id"))
x_destination.append(qualifier.attrib.get("value"))
y_destination.append(qualifier.attrib.get("value"))
"""
# If the qualifier is relevant, append the information to the x or y destination lists
if qualifier.attrib.get("qualifier_id") == "140":
x_destination.append(qualifier.attrib.get("value"))
if qualifier.attrib.get("qualifier_id") == "141":
y_destination.append(qualifier.attrib.get("value"))
"""
"""
#Iterate through each game in our file - we only have one
for game in gameFile:
#Iterate through each event
for event in game:
#If the event is a pass (ID = 1)
if event.attrib.get("type_id") == '1':
#To the correct list, append the correct attribute using attrib.get()
x_origin.append(event.attrib.get("x"))
y_origin.append(event.attrib.get("y"))
outcome.append(event.attrib.get("outcome"))
minute.append(event.attrib.get("min"))
half.append(event.attrib.get("period_id"))
team.append(team_dict[event.attrib.get("team_id")])
#Iterate through each qualifier
for qualifier in event:
#If the qualifier is relevant, append the information to the x or y destination lists
if qualifier.attrib.get("qualifier_id") == "140":
x_destination.append(qualifier.attrib.get("value"))
if qualifier.attrib.get("qualifier_id") == "141":
y_destination.append(qualifier.attrib.get("value"))
"""
'\n#Iterate through each game in our file - we only have one\nfor game in gameFile:\n \n #Iterate through each event\n for event in game:\n \n #If the event is a pass (ID = 1)\n if event.attrib.get("type_id") == \'1\':\n \n #To the correct list, append the correct attribute using attrib.get()\n x_origin.append(event.attrib.get("x"))\n y_origin.append(event.attrib.get("y"))\n outcome.append(event.attrib.get("outcome"))\n minute.append(event.attrib.get("min"))\n half.append(event.attrib.get("period_id"))\n team.append(team_dict[event.attrib.get("team_id")])\n \n #Iterate through each qualifier \n for qualifier in event:\n \n #If the qualifier is relevant, append the information to the x or y destination lists\n if qualifier.attrib.get("qualifier_id") == "140":\n x_destination.append(qualifier.attrib.get("value"))\n if qualifier.attrib.get("qualifier_id") == "141":\n y_destination.append(qualifier.attrib.get("value"))\n'
If this has worked correctly, we should have 8 lists populated. Let’s check out the minutes list:
print("The minute list is " + str(len(minute)) + " long and the 43rd entry is " + minute[42])
The list is 1673 long and the 43rd entry is 2
print("The ID list is " + str(len(ids)) + " long and the 43rd entry is " + minute[42])
The ID list is 1673 long and the 43rd entry is 2
You can check out each list in more detail, but they should work just fine.
Our final task is to create a table for our data from our lists. To do this, we just need to create a list of our column headers, then assign the list to each one. We’ll then flip our table to make it long, rather than wide – just like you would want to see in a spreadsheet. Let’s take a look:
# Create a list of our 8 columns/lists
column_titles = ["ids", "event_id", "type_id", "team", "half", "min", "x_origin", "y_origin", "x_destination", "y_destination", "outcome", "qualifier_id"]
# Use pd.DataFrame to create our table, assign the data in the order of our columns and give it the column titles above
final_table = pd.DataFrame(data=[ids, event_id, type_id, team, half, minute, x_origin, y_origin, x_destination, y_destination, outcome, qualifier_id], index=column_titles)
# Transpose, or flip, the table. Otherwise, our table will run from left to right, rather than top to bottom
final_table = final_table.T
# Show us the top 5 rows of the table
final_table.head()
ids | event_id | type_id | team | half | min | x_origin | y_origin | x_destination | y_destination | outcome | qualifier_id | |
---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 301038339 | 1 | 34 | Manchester City | 16 | 0 | 0.0 | 0.0 | 4 | 4 | 1 | None |
1 | 1475524684 | 1 | 34 | Bolton Wanderers | 16 | 0 | 0.0 | 0.0 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0... | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0... | 1 | None |
2 | 2036897618 | 2 | 32 | Bolton Wanderers | 1 | 0 | 0.0 | 0.0 | 25, 2, 13, 18, 4, 6, 42, 7, 10, 16, 21, 5, 11,... | 25, 2, 13, 18, 4, 6, 42, 7, 10, 16, 21, 5, 11,... | 1 | None |
3 | 336246484 | 2 | 32 | Manchester City | 1 | 0 | 0.0 | 0.0 | 17476 | 17476 | 1 | None |
4 | 1372839298 | 3 | 1 | Manchester City | 1 | 0 | 50.1 | 50.0 | 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0, 0, 0, 0,... | 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0, 0, 0, 0,... | 1 | None |
final_table.shape
(6601, 12)
So this is great for passes, and the same logic would apply for shots, fouls or even all events at the same time – just expand on the above with the relevant IDs from the Opta docs. And analysts, if you’re still struggling to get it done, the emergency loan window is always open!
Now that we’ve taken a complex XML and parsed the passes into a table, there’s a number of things that we can do. We could put the table into a wider dataset, do some analysis of these passes, visualise straight away or just export our new table to a csv:
df_opta_events_only = df_opta_event_definitions.drop([1, 0], axis=1)
df_opta_events_only
id | name | |
---|---|---|
0 | 1 | Pass |
1 | 2 | Offside Pass |
2 | 3 | Take On |
3 | 4 | Free kick |
4 | 5 | Out |
... | ... | ... |
59 | 62 | Event placeholder |
60 | 60 | Chance Missed |
61 | 61 | Ball touch |
62 | 63 | Temp_Save |
63 | 64 | Resume |
64 rows × 2 columns
final_table
ids | event_id | type_id | team | half | min | x_origin | y_origin | x_destination | y_destination | outcome | qualifier_id | |
---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 301038339 | 1 | 34 | Manchester City | 16 | 0 | 0.0 | 0.0 | 4 | 4 | 1 | None |
1 | 1475524684 | 1 | 34 | Bolton Wanderers | 16 | 0 | 0.0 | 0.0 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0... | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0... | 1 | None |
2 | 2036897618 | 2 | 32 | Bolton Wanderers | 1 | 0 | 0.0 | 0.0 | 25, 2, 13, 18, 4, 6, 42, 7, 10, 16, 21, 5, 11,... | 25, 2, 13, 18, 4, 6, 42, 7, 10, 16, 21, 5, 11,... | 1 | None |
3 | 336246484 | 2 | 32 | Manchester City | 1 | 0 | 0.0 | 0.0 | 17476 | 17476 | 1 | None |
4 | 1372839298 | 3 | 1 | Manchester City | 1 | 0 | 50.1 | 50.0 | 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0, 0, 0, 0,... | 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0, 0, 0, 0,... | 1 | None |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
6596 | None | None | None | None | None | None | None | None | None | None | None | None |
6597 | None | None | None | None | None | None | None | None | None | None | None | None |
6598 | None | None | None | None | None | None | None | None | None | None | None | None |
6599 | None | None | None | None | None | None | None | None | 1 | 1 | None | None |
6600 | None | None | None | None | None | None | None | None | None | None | None | None |
6601 rows × 12 columns
df_opta_events_only['id'] = df_opta_events_only['id'].to_string()
final_table.dtypes
ids object event_id object type_id object team object half object min object x_origin object y_origin object x_destination object y_destination object outcome object qualifier_id object dtype: object
df_opta_events_only.dtypes
id object name object dtype: object
# Join the Bio and Status DataFrames to form one, unified DataFrame
test = pd.merge(final_table, df_opta_events_only, left_on='event_id', right_on='id', how='left')
test
ids | event_id | type_id | team | half | min | x_origin | y_origin | x_destination | y_destination | outcome | qualifier_id | id | name | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 301038339 | 1 | 34 | Manchester City | 16 | 0 | 0.0 | 0.0 | 4 | 4 | 1 | None | NaN | NaN |
1 | 1475524684 | 1 | 34 | Bolton Wanderers | 16 | 0 | 0.0 | 0.0 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0... | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0... | 1 | None | NaN | NaN |
2 | 2036897618 | 2 | 32 | Bolton Wanderers | 1 | 0 | 0.0 | 0.0 | 25, 2, 13, 18, 4, 6, 42, 7, 10, 16, 21, 5, 11,... | 25, 2, 13, 18, 4, 6, 42, 7, 10, 16, 21, 5, 11,... | 1 | None | NaN | NaN |
3 | 336246484 | 2 | 32 | Manchester City | 1 | 0 | 0.0 | 0.0 | 17476 | 17476 | 1 | None | NaN | NaN |
4 | 1372839298 | 3 | 1 | Manchester City | 1 | 0 | 50.1 | 50.0 | 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0, 0, 0, 0,... | 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0, 0, 0, 0,... | 1 | None | NaN | NaN |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
6596 | None | None | None | None | None | None | None | None | None | None | None | None | NaN | NaN |
6597 | None | None | None | None | None | None | None | None | None | None | None | None | NaN | NaN |
6598 | None | None | None | None | None | None | None | None | None | None | None | None | NaN | NaN |
6599 | None | None | None | None | None | None | None | None | 1 | 1 | None | None | NaN | NaN |
6600 | None | None | None | None | None | None | None | None | None | None | None | None | NaN | NaN |
6601 rows × 14 columns
df_opta_f24_raw = test
Let's quality of the dataset by looking first and last rows in pandas using the head() and tail() methods.
# Display the first 5 rows of the raw DataFrame, df_opta_f24_raw
df_opta_f24_raw.head()
ids | event_id | type_id | team | half | min | x_origin | y_origin | x_destination | y_destination | outcome | qualifier_id | id | name | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 301038339 | 1 | 34 | Manchester City | 16 | 0 | 0.0 | 0.0 | 4 | 4 | 1 | None | NaN | NaN |
1 | 1475524684 | 1 | 34 | Bolton Wanderers | 16 | 0 | 0.0 | 0.0 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0... | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0... | 1 | None | NaN | NaN |
2 | 2036897618 | 2 | 32 | Bolton Wanderers | 1 | 0 | 0.0 | 0.0 | 25, 2, 13, 18, 4, 6, 42, 7, 10, 16, 21, 5, 11,... | 25, 2, 13, 18, 4, 6, 42, 7, 10, 16, 21, 5, 11,... | 1 | None | NaN | NaN |
3 | 336246484 | 2 | 32 | Manchester City | 1 | 0 | 0.0 | 0.0 | 17476 | 17476 | 1 | None | NaN | NaN |
4 | 1372839298 | 3 | 1 | Manchester City | 1 | 0 | 50.1 | 50.0 | 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0, 0, 0, 0,... | 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0, 0, 0, 0,... | 1 | None | NaN | NaN |
# Display the last 5 rows of the raw DataFrame, df_opta_f24_raw
df_opta_f24_raw.tail()
ids | event_id | type_id | team | half | min | x_origin | y_origin | x_destination | y_destination | outcome | qualifier_id | id | name | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6596 | None | None | None | None | None | None | None | None | None | None | None | None | NaN | NaN |
6597 | None | None | None | None | None | None | None | None | None | None | None | None | NaN | NaN |
6598 | None | None | None | None | None | None | None | None | None | None | None | None | NaN | NaN |
6599 | None | None | None | None | None | None | None | None | 1 | 1 | None | None | NaN | NaN |
6600 | None | None | None | None | None | None | None | None | None | None | None | None | NaN | NaN |
# Print the shape of the raw DataFrame, df_opta_f24_raw
print(df_opta_f24_raw.shape)
(6601, 14)
# Print the column names of the raw DataFrame, df_opta_f24_raw
print(df_opta_f24_raw.columns)
Index(['ids', 'event_id', 'type_id', 'team', 'half', 'min', 'x_origin', 'y_origin', 'x_destination', 'y_destination', 'outcome', 'qualifier_id', 'id', 'name'], dtype='object')
The dataset has two hundred and ten features (columns). Full details of these attributes can be found in the Data Dictionary.
# Data types of the features of the raw DataFrame, df_opta_f24_raw
df_opta_f24_raw.dtypes
ids object event_id object type_id object team object half object min object x_origin object y_origin object x_destination object y_destination object outcome object qualifier_id object id object name object dtype: object
All six of the columns have the object data type. Full details of these attributes and their data types can be found in the Data Dictionary.
# Info for the raw DataFrame, df_opta_f24_raw
df_opta_f24_raw.info()
<class 'pandas.core.frame.DataFrame'> Int64Index: 6601 entries, 0 to 6600 Data columns (total 14 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 ids 1673 non-null object 1 event_id 1673 non-null object 2 type_id 1673 non-null object 3 team 1673 non-null object 4 half 1673 non-null object 5 min 1673 non-null object 6 x_origin 1673 non-null object 7 y_origin 1673 non-null object 8 x_destination 5513 non-null object 9 y_destination 5513 non-null object 10 outcome 1673 non-null object 11 qualifier_id 0 non-null object 12 id 0 non-null object 13 name 0 non-null object dtypes: object(14) memory usage: 773.6+ KB
# Description of the raw DataFrame, df_opta_f24_raw, showing some summary statistics for each numberical column in the DataFrame
df_opta_mbm_raw.describe()
Player ID | Team Id | Opposition id | Position Id | Appearances | Time Played | Starts | Substitute On | Substitute Off | Goals | First Goal | Winning Goal | Shots On Target inc goals | Shots Off Target inc woodwork | Blocked Shots | Penalties Taken | Penalty Goals | Penalties Saved | Penalties Off Target | Penalties Not Scored | Direct Free-kick Goals | Direct Free-kick On Target | Direct Free-kick Off Target | Blocked Direct Free-kick | Goals from Inside Box | Shots On from Inside Box | Shots Off from Inside Box | Blocked Shots from Inside Box | Goals from Outside Box | Shots On Target Outside Box | Shots Off Target Outside Box | Blocked Shots Outside Box | Headed Goals | Headed Shots On Target | Headed Shots Off Target | Headed Blocked Shots | Left Foot Goals | Left Foot Shots On Target | Left Foot Shots Off Target | Left Foot Blocked Shots | Right Foot Goals | Right Foot Shots On Target | Right Foot Shots Off Target | Right Foot Blocked Shots | Other Goals | Other Shots On Target | Other Shots Off Target | Other Blocked Shots | Shots Cleared off Line | Shots Cleared off Line Inside Area | Shots Cleared off Line Outside Area | Goals Open Play | Goals from Corners | Goals from Throws | Goals from Direct Free Kick | Goals from Set Play | Goals from penalties | Attempts Open Play on target | Attempts from Corners on target | Attempts from Throws on target | Attempts from Direct Free Kick on target | Attempts from Set Play on target | Attempts from Penalties on target | Attempts Open Play off target | Attempts from Corners off target | Attempts from Throws off target | Attempts from Direct Free Kick off target | Attempts from Set Play off target | Attempts from Penalties off target | Goals as a substitute | Total Successful Passes All | Total Unsuccessful Passes All | Assists | Key Passes | Total Successful Passes Excl Crosses Corners | Total Unsuccessful Passes Excl Crosses Corners | Successful Passes Own Half | Unsuccessful Passes Own Half | Successful Passes Opposition Half | Unsuccessful Passes Opposition Half | Successful Passes Defensive third | Unsuccessful Passes Defensive third | Successful Passes Middle third | Unsuccessful Passes Middle third | Successful Passes Final third | Unsuccessful Passes Final third | Successful Short Passes | Unsuccessful Short Passes | Successful Long Passes | Unsuccessful Long Passes | Successful Flick-Ons | Unsuccessful Flick-Ons | Successful Crosses Corners | Unsuccessful Crosses Corners | Corners Taken incl short corners | Corners Conceded | Successful Corners into Box | Unsuccessful Corners into Box | Short Corners | Throw Ins to Own Player | Throw Ins to Opposition Player | Successful Dribbles | Unsuccessful Dribbles | Successful Crosses Corners Left | Unsuccessful Crosses Corners Left | Successful Crosses Left | Unsuccessful Crosses Left | Successful Corners Left | Unsuccessful Corners Left | Successful Crosses Corners Right | Unsuccessful Crosses Corners Right | Successful Crosses Right | Unsuccessful Crosses Right | Successful Corners Right | Unsuccessful Corners Right | Successful Long Balls | Unsuccessful Long Balls | Successful Lay-Offs | Unsuccessful Lay-Offs | Through Ball | Successful Crosses Corners in the air | Unsuccessful Crosses Corners in the air | Successful crosses in the air | Unsuccessful crosses in the air | Successful open play crosses | Unsuccessful open play crosses | Touches | Goal Assist Corner | Goal Assist Free Kick | Goal Assist Throw In | Goal Assist Goal Kick | Goal Assist Set Piece | Key Corner | Key Free Kick | Key Throw In | Key Goal Kick | Key Set Pieces | Duels won | Duels lost | Aerial Duels won | Aerial Duels lost | Ground Duels won | Ground Duels lost | Tackles Won | Tackles Lost | Last Man Tackle | Total Clearances | Headed Clearances | Other Clearances | Clearances Off the Line | Blocks | Interceptions | Recoveries | Total Fouls Conceded | Fouls Conceded exc handballs pens | Total Fouls Won | Fouls Won in Danger Area inc pens | Fouls Won not in danger area | Foul Won Penalty | Handballs Conceded | Penalties Conceded | Offsides | Yellow Cards | Red Cards | Goals Conceded | Goals Conceded Inside Box | Goals Conceded Outside Box | Saves Made | Saves Made from Inside Box | Saves Made from Outside Box | Saves from Penalty | Catches | Punches | Drops | Crosses not Claimed | GK Distribution | GK Successful Distribution | GK Unsuccessful Distribution | Clean Sheets | Team Clean sheet | Error leading to Goal | Error leading to Attempt | Challenge Lost | Shots On Conceded | Shots On Conceded Inside Box | Shots On Conceded Outside Box | Team Formation | Position in Formation | Turnovers | Dispossessed | Big Chances | Big Chances Faced | Pass Forward | Pass Backward | Pass Left | Pass Right | Unsuccessful Ball Touch | Successful Ball Touch | Take-Ons Overrun | CompId | SeasId | Touches open play final third | Touches open play opp box | Touches open play opp six yards | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
count | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.0 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.00000 | 10369.0 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.0 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.0 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.000000 | 10369.0 | 10369.0 | 10369.000000 | 10369.000000 | 10369.000000 |
mean | 25662.119684 | 35.688012 | 35.774617 | 3.543061 | 1.0 | 72.366091 | 0.806249 | 0.193751 | 0.193751 | 0.098852 | 0.034044 | 0.026714 | 0.339666 | 0.430803 | 0.279873 | 0.009644 | 0.006944 | 0.002218 | 0.000482 | 0.002700 | 0.002797 | 0.013695 | 0.018999 | 0.020638 | 0.081782 | 0.223551 | 0.236378 | 0.124699 | 0.017070 | 0.116115 | 0.194426 | 0.155174 | 0.017649 | 0.055454 | 0.096152 | 0.018902 | 0.028450 | 0.106664 | 0.131450 | 0.103964 | 0.051885 | 0.176391 | 0.202237 | 0.156910 | 0.000868 | 0.001157 | 0.000964 | 0.000096 | 0.011477 | 0.010994 | 0.000482 | 0.069824 | 0.012441 | 0.001929 | 0.002797 | 0.006365 | 0.006944 | 0.241007 | 0.036358 | 0.006462 | 0.013695 | 0.017359 | 0.009162 | 0.290963 | 0.072813 | 0.011284 | 0.018999 | 0.025461 | 0.000482 | 0.010512 | 25.971357 | 7.963159 | 0.070306 | 0.714341 | 24.937217 | 6.370335 | 11.376121 | 1.361558 | 13.561096 | 5.008776 | 4.719549 | 0.356254 | 13.616356 | 2.603048 | 6.601312 | 3.411033 | 22.717716 | 4.565918 | 2.219500 | 1.804417 | 0.193847 | 0.432539 | 0.378436 | 1.236281 | 0.416723 | 0.417784 | 0.112161 | 0.224998 | 0.063941 | 1.306973 | 0.321439 | 0.476131 | 0.604012 | 0.178031 | 0.585109 | 0.124409 | 0.475070 | 0.053621 | 0.110040 | 0.194426 | 0.645289 | 0.135404 | 0.530041 | 0.059022 | 0.115247 | 0.559553 | 1.354229 | 1.187096 | 0.086508 | 0.067509 | 0.344585 | 1.092873 | 0.233484 | 0.870672 | 0.256630 | 1.005111 | 46.192111 | 0.009065 | 0.004822 | 0.00164 | 0.0 | 0.015527 | 0.072717 | 0.029029 | 0.007040 | 0.000482 | 0.109268 | 3.388659 | 3.504581 | 0.774327 | 0.774327 | 2.614331 | 2.730254 | 1.028354 | 0.352204 | 0.012827 | 2.175234 | 1.108689 | 1.066545 | 0.011380 | 0.268493 | 1.170701 | 6.719645 | 0.798438 | 0.747902 | 0.756679 | 0.185650 | 0.571029 | 0.008776 | 0.041759 | 0.009644 | 0.163179 | 0.111293 | 0.006365 | 0.102806 | 0.085736 | 0.017070 | 0.229337 | 0.130774 | 0.098563 | 0.002218 | 0.093355 | 0.039927 | 0.008101 | 0.006365 | 1.012248 | 0.655705 | 0.356544 | 0.019867 | 0.0 | 0.013984 | 0.015045 | 0.476034 | 0.343620 | 0.227505 | 0.116115 | 4.858810 | 7.704504 | 0.0 | 0.893529 | 0.131160 | 0.131160 | 12.386826 | 4.787829 | 8.344874 | 8.414987 | 0.864500 | 0.771048 | 0.115826 | 8.0 | 2011.0 | 10.300415 | 1.463786 | 0.107629 |
std | 20790.034876 | 33.297585 | 33.311032 | 1.581414 | 0.0 | 28.596946 | 0.395255 | 0.395255 | 0.395255 | 0.343547 | 0.181350 | 0.161255 | 0.703668 | 0.754654 | 0.588913 | 0.100652 | 0.084197 | 0.047047 | 0.021955 | 0.051897 | 0.054609 | 0.122685 | 0.142067 | 0.146191 | 0.310355 | 0.557791 | 0.556045 | 0.378299 | 0.132484 | 0.373737 | 0.476901 | 0.429134 | 0.135290 | 0.249829 | 0.344032 | 0.139684 | 0.171966 | 0.373716 | 0.401078 | 0.355719 | 0.243766 | 0.491476 | 0.506222 | 0.436751 | 0.029450 | 0.034001 | 0.031042 | 0.009820 | 0.107419 | 0.105202 | 0.021955 | 0.286907 | 0.113429 | 0.043878 | 0.054609 | 0.079531 | 0.084197 | 0.577912 | 0.196736 | 0.082500 | 0.122685 | 0.131349 | 0.098273 | 0.614037 | 0.286668 | 0.107439 | 0.142067 | 0.161159 | 0.021955 | 0.105708 | 17.854129 | 5.393289 | 0.278081 | 1.092018 | 18.042517 | 4.287731 | 10.298305 | 1.516356 | 10.923421 | 3.670587 | 4.940019 | 0.667245 | 11.270300 | 2.304931 | 6.038887 | 2.806933 | 16.976651 | 3.511626 | 2.750183 | 2.955452 | 0.579881 | 1.101918 | 0.865748 | 2.071939 | 1.294514 | 0.782609 | 0.471052 | 0.782234 | 0.318023 | 2.879792 | 1.026728 | 0.897868 | 1.082000 | 0.551667 | 1.354759 | 0.432958 | 1.138033 | 0.287367 | 0.487443 | 0.584988 | 1.370692 | 0.445083 | 1.179284 | 0.323029 | 0.505304 | 1.439410 | 2.470269 | 1.874924 | 0.330340 | 0.280326 | 0.820961 | 1.912071 | 0.585622 | 1.489792 | 0.615836 | 1.646309 | 24.211531 | 0.096799 | 0.069277 | 0.04046 | 0.0 | 0.125193 | 0.333792 | 0.179554 | 0.095463 | 0.021955 | 0.417268 | 2.775550 | 2.968456 | 1.323165 | 1.235718 | 2.351835 | 2.505136 | 1.277690 | 0.660982 | 0.117562 | 3.276374 | 2.025839 | 1.660291 | 0.106979 | 0.621481 | 1.447242 | 4.676845 | 1.021978 | 0.985476 | 1.017644 | 0.475035 | 0.844939 | 0.094302 | 0.209929 | 0.097735 | 0.525938 | 0.314510 | 0.079531 | 0.503116 | 0.434434 | 0.147634 | 0.991118 | 0.625514 | 0.492348 | 0.047047 | 0.472593 | 0.267062 | 0.097875 | 0.085380 | 3.758933 | 2.535186 | 1.491775 | 0.139550 | 0.0 | 0.119869 | 0.122527 | 0.812369 | 1.412394 | 0.990421 | 0.556613 | 2.515103 | 4.569704 | 0.0 | 1.250866 | 0.428717 | 0.645917 | 9.273106 | 4.134100 | 7.870851 | 7.859229 | 1.216473 | 1.024039 | 0.378315 | 0.0 | 0.0 | 9.803810 | 2.115097 | 0.362961 |
min | 3.000000 | 1.000000 | 1.000000 | 1.000000 | 1.0 | 1.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.00000 | 0.0 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.0 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 2.000000 | 1.000000 | 0.0 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 8.0 | 2011.0 | 0.000000 | 0.000000 | 0.000000 |
25% | 10561.000000 | 7.000000 | 6.000000 | 2.000000 | 1.0 | 65.000000 | 1.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 13.000000 | 4.000000 | 0.000000 | 0.000000 | 11.000000 | 3.000000 | 4.000000 | 0.000000 | 5.000000 | 2.000000 | 1.000000 | 0.000000 | 5.000000 | 1.000000 | 2.000000 | 1.000000 | 10.000000 | 2.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 30.000000 | 0.000000 | 0.000000 | 0.00000 | 0.0 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 1.000000 | 1.000000 | 0.000000 | 0.000000 | 1.000000 | 1.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 3.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.0 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 2.000000 | 4.000000 | 0.0 | 0.000000 | 0.000000 | 0.000000 | 5.000000 | 1.000000 | 2.000000 | 2.000000 | 0.000000 | 0.000000 | 0.000000 | 8.0 | 2011.0 | 2.000000 | 0.000000 | 0.000000 |
50% | 19188.000000 | 30.000000 | 35.000000 | 4.000000 | 1.0 | 90.000000 | 1.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 23.000000 | 7.000000 | 0.000000 | 0.000000 | 21.000000 | 6.000000 | 9.000000 | 1.000000 | 11.000000 | 4.000000 | 3.000000 | 0.000000 | 11.000000 | 2.000000 | 5.000000 | 3.000000 | 20.000000 | 4.000000 | 1.000000 | 1.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 46.000000 | 0.000000 | 0.000000 | 0.00000 | 0.0 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 3.000000 | 3.000000 | 0.000000 | 0.000000 | 2.000000 | 2.000000 | 1.000000 | 0.000000 | 0.000000 | 1.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 1.000000 | 6.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.0 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 5.000000 | 7.000000 | 0.0 | 0.000000 | 0.000000 | 0.000000 | 11.000000 | 4.000000 | 6.000000 | 6.000000 | 0.000000 | 0.000000 | 0.000000 | 8.0 | 2011.0 | 8.000000 | 1.000000 | 0.000000 |
75% | 39765.000000 | 52.000000 | 54.000000 | 4.000000 | 1.0 | 90.000000 | 1.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 1.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 36.000000 | 11.000000 | 0.000000 | 1.000000 | 35.000000 | 9.000000 | 16.000000 | 2.000000 | 19.000000 | 7.000000 | 7.000000 | 1.000000 | 19.000000 | 4.000000 | 10.000000 | 5.000000 | 32.000000 | 7.000000 | 3.000000 | 2.000000 | 0.000000 | 0.000000 | 0.000000 | 2.000000 | 0.000000 | 1.000000 | 0.000000 | 0.000000 | 0.000000 | 1.000000 | 0.000000 | 1.000000 | 1.000000 | 0.000000 | 1.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 1.000000 | 0.000000 | 1.000000 | 0.000000 | 0.000000 | 0.000000 | 2.000000 | 2.000000 | 0.000000 | 0.000000 | 0.000000 | 1.000000 | 0.000000 | 1.000000 | 0.000000 | 1.000000 | 62.000000 | 0.000000 | 0.000000 | 0.00000 | 0.0 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 5.000000 | 5.000000 | 1.000000 | 1.000000 | 4.000000 | 4.000000 | 2.000000 | 1.000000 | 0.000000 | 3.000000 | 1.000000 | 2.000000 | 0.000000 | 0.000000 | 2.000000 | 10.000000 | 1.000000 | 1.000000 | 1.000000 | 0.000000 | 1.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.0 | 0.000000 | 0.000000 | 1.000000 | 0.000000 | 0.000000 | 0.000000 | 6.000000 | 11.000000 | 0.0 | 1.000000 | 0.000000 | 0.000000 | 18.000000 | 7.000000 | 12.000000 | 12.000000 | 1.000000 | 1.000000 | 0.000000 | 8.0 | 2011.0 | 16.000000 | 2.000000 | 0.000000 |
max | 114042.000000 | 111.000000 | 111.000000 | 6.000000 | 1.0 | 90.000000 | 1.000000 | 1.000000 | 1.000000 | 4.000000 | 1.000000 | 1.000000 | 9.000000 | 6.000000 | 5.000000 | 2.000000 | 2.000000 | 1.000000 | 1.000000 | 1.000000 | 2.000000 | 2.000000 | 2.000000 | 2.000000 | 4.000000 | 7.000000 | 6.000000 | 5.000000 | 2.000000 | 5.000000 | 4.000000 | 4.000000 | 2.000000 | 3.000000 | 5.000000 | 2.000000 | 2.000000 | 5.000000 | 4.000000 | 5.000000 | 3.000000 | 8.000000 | 5.000000 | 4.000000 | 1.000000 | 1.000000 | 1.000000 | 1.000000 | 2.000000 | 2.000000 | 1.000000 | 4.000000 | 2.000000 | 1.000000 | 2.000000 | 1.000000 | 2.000000 | 7.000000 | 2.000000 | 2.000000 | 2.000000 | 2.000000 | 2.000000 | 5.000000 | 4.000000 | 2.000000 | 2.000000 | 2.000000 | 1.000000 | 2.000000 | 157.000000 | 38.000000 | 4.000000 | 9.000000 | 157.000000 | 31.000000 | 77.000000 | 12.000000 | 106.000000 | 28.000000 | 48.000000 | 6.000000 | 117.000000 | 17.000000 | 58.000000 | 22.000000 | 156.000000 | 24.000000 | 26.000000 | 30.000000 | 10.000000 | 13.000000 | 9.000000 | 22.000000 | 16.000000 | 7.000000 | 5.000000 | 13.000000 | 6.000000 | 22.000000 | 12.000000 | 9.000000 | 11.000000 | 7.000000 | 16.000000 | 6.000000 | 13.000000 | 4.000000 | 7.000000 | 7.000000 | 15.000000 | 5.000000 | 14.000000 | 5.000000 | 9.000000 | 22.000000 | 25.000000 | 18.000000 | 4.000000 | 3.000000 | 8.000000 | 22.000000 | 6.000000 | 13.000000 | 6.000000 | 14.000000 | 175.000000 | 2.000000 | 1.000000 | 1.00000 | 0.0 | 2.000000 | 5.000000 | 3.000000 | 4.000000 | 1.000000 | 5.000000 | 19.000000 | 20.000000 | 15.000000 | 12.000000 | 17.000000 | 18.000000 | 11.000000 | 6.000000 | 2.000000 | 25.000000 | 17.000000 | 12.000000 | 2.000000 | 8.000000 | 12.000000 | 26.000000 | 8.000000 | 8.000000 | 8.000000 | 4.000000 | 7.000000 | 2.000000 | 3.000000 | 1.000000 | 6.000000 | 1.000000 | 1.000000 | 8.000000 | 6.000000 | 3.000000 | 12.000000 | 10.000000 | 8.000000 | 1.000000 | 8.000000 | 5.000000 | 3.000000 | 3.000000 | 26.000000 | 22.000000 | 16.000000 | 1.000000 | 0.0 | 2.000000 | 2.000000 | 9.000000 | 15.000000 | 13.000000 | 8.000000 | 17.000000 | 18.000000 | 0.0 | 9.000000 | 6.000000 | 9.000000 | 54.000000 | 29.000000 | 66.000000 | 67.000000 | 9.000000 | 9.000000 | 5.000000 | 8.0 | 2011.0 | 78.000000 | 21.000000 | 4.000000 |
# Plot visualisation of the missing values for each feature of the raw DataFrame, df_opta_f24_raw
msno.matrix(df_opta_f24_raw, figsize = (30, 7))
<matplotlib.axes._subplots.AxesSubplot at 0x1a1bccb350>
# Counts of missing values
opta_null_value_stats = df_opta_f24_raw.isnull().sum(axis=0)
opta_null_value_stats[opta_null_value_stats != 0]
ids 4928 event_id 4928 type_id 4928 team 4928 half 4928 min 4928 x_origin 4928 y_origin 4928 x_destination 1088 y_destination 1088 outcome 4928 qualifier_id 6601 id 6601 name 6601 dtype: int64
The visualisation shows us that the only field with missing values is the Player Forename
attribute. This is something that will be fixed in the Data Engineering section.
As per the Data Sources section, the Data Engineering section is divided into two sections for the aggregated match-by-match performance data and F24 Event data for Manchester City vs. Bolton Wanders (21/08/2011).
# Assign Raw DataFrame to Engineered DataFrame
df_opta_mbm = df_opta_mbm_raw
Player Forename
and Player Surname
¶Some players such as 'Kolo Touré' have a null value for the Player Forename
attribute. The foollowing cleans this code and derives a cleaned Player Surname
and Player Full Name
attribute.
# Clean names
## Forename
df_opta_mbm['Player Forename Cleaned'] = np.where(df_opta_mbm['Player Forename'].isnull(), df_opta_mbm['Player Surname'].str.split(' ').str[0], df_opta_mbm['Player Forename'])
## Surname
df_opta_mbm['Player Surname Cleaned'] = np.where(df_opta_mbm['Player Forename'].notnull(), df_opta_mbm['Player Surname'], df_opta_mbm['Player Surname'].str.split(' ').str[1])
## Create Full Name attribute from cleaned Forename and Surname attributes
df_opta_mbm['Player Full Name'] = df_opta_mbm['Player Forename Cleaned'] + ' ' + df_opta_mbm['Player Surname Cleaned']
# Test of 'Kolo Touré' - had a blank first name in the database
df_opta_mbm[df_opta_mbm['Player Surname'] == 'Kolo Touré']
Date | Player ID | Player Surname | Player Forename | Team | Team Id | Opposition | Opposition id | Venue | Position Id | Appearances | Time Played | Starts | Substitute On | Substitute Off | Goals | First Goal | Winning Goal | Shots On Target inc goals | Shots Off Target inc woodwork | Blocked Shots | Penalties Taken | Penalty Goals | Penalties Saved | Penalties Off Target | Penalties Not Scored | Direct Free-kick Goals | Direct Free-kick On Target | Direct Free-kick Off Target | Blocked Direct Free-kick | Goals from Inside Box | Shots On from Inside Box | Shots Off from Inside Box | Blocked Shots from Inside Box | Goals from Outside Box | Shots On Target Outside Box | Shots Off Target Outside Box | Blocked Shots Outside Box | Headed Goals | Headed Shots On Target | Headed Shots Off Target | Headed Blocked Shots | Left Foot Goals | Left Foot Shots On Target | Left Foot Shots Off Target | Left Foot Blocked Shots | Right Foot Goals | Right Foot Shots On Target | Right Foot Shots Off Target | Right Foot Blocked Shots | Other Goals | Other Shots On Target | Other Shots Off Target | Other Blocked Shots | Shots Cleared off Line | Shots Cleared off Line Inside Area | Shots Cleared off Line Outside Area | Goals Open Play | Goals from Corners | Goals from Throws | Goals from Direct Free Kick | Goals from Set Play | Goals from penalties | Attempts Open Play on target | Attempts from Corners on target | Attempts from Throws on target | Attempts from Direct Free Kick on target | Attempts from Set Play on target | Attempts from Penalties on target | Attempts Open Play off target | Attempts from Corners off target | Attempts from Throws off target | Attempts from Direct Free Kick off target | Attempts from Set Play off target | Attempts from Penalties off target | Goals as a substitute | Total Successful Passes All | Total Unsuccessful Passes All | Assists | Key Passes | Total Successful Passes Excl Crosses Corners | Total Unsuccessful Passes Excl Crosses Corners | Successful Passes Own Half | Unsuccessful Passes Own Half | Successful Passes Opposition Half | Unsuccessful Passes Opposition Half | Successful Passes Defensive third | Unsuccessful Passes Defensive third | Successful Passes Middle third | Unsuccessful Passes Middle third | Successful Passes Final third | Unsuccessful Passes Final third | Successful Short Passes | Unsuccessful Short Passes | Successful Long Passes | Unsuccessful Long Passes | Successful Flick-Ons | Unsuccessful Flick-Ons | Successful Crosses Corners | Unsuccessful Crosses Corners | Corners Taken incl short corners | Corners Conceded | Successful Corners into Box | Unsuccessful Corners into Box | Short Corners | Throw Ins to Own Player | Throw Ins to Opposition Player | Successful Dribbles | Unsuccessful Dribbles | Successful Crosses Corners Left | Unsuccessful Crosses Corners Left | Successful Crosses Left | Unsuccessful Crosses Left | Successful Corners Left | Unsuccessful Corners Left | Successful Crosses Corners Right | Unsuccessful Crosses Corners Right | Successful Crosses Right | Unsuccessful Crosses Right | Successful Corners Right | Unsuccessful Corners Right | Successful Long Balls | Unsuccessful Long Balls | Successful Lay-Offs | Unsuccessful Lay-Offs | Through Ball | Successful Crosses Corners in the air | Unsuccessful Crosses Corners in the air | Successful crosses in the air | Unsuccessful crosses in the air | Successful open play crosses | Unsuccessful open play crosses | Touches | Goal Assist Corner | Goal Assist Free Kick | Goal Assist Throw In | Goal Assist Goal Kick | Goal Assist Set Piece | Key Corner | Key Free Kick | Key Throw In | Key Goal Kick | Key Set Pieces | Duels won | Duels lost | Aerial Duels won | Aerial Duels lost | Ground Duels won | Ground Duels lost | Tackles Won | Tackles Lost | Last Man Tackle | Total Clearances | Headed Clearances | Other Clearances | Clearances Off the Line | Blocks | Interceptions | Recoveries | Total Fouls Conceded | Fouls Conceded exc handballs pens | Total Fouls Won | Fouls Won in Danger Area inc pens | Fouls Won not in danger area | Foul Won Penalty | Handballs Conceded | Penalties Conceded | Offsides | Yellow Cards | Red Cards | Goals Conceded | Goals Conceded Inside Box | Goals Conceded Outside Box | Saves Made | Saves Made from Inside Box | Saves Made from Outside Box | Saves from Penalty | Catches | Punches | Drops | Crosses not Claimed | GK Distribution | GK Successful Distribution | GK Unsuccessful Distribution | Clean Sheets | Team Clean sheet | Error leading to Goal | Error leading to Attempt | Challenge Lost | Shots On Conceded | Shots On Conceded Inside Box | Shots On Conceded Outside Box | Team Formation | Position in Formation | Turnovers | Dispossessed | Big Chances | Big Chances Faced | Pass Forward | Pass Backward | Pass Left | Pass Right | Unsuccessful Ball Touch | Successful Ball Touch | Take-Ons Overrun | CompId | SeasId | Touches open play final third | Touches open play opp box | Touches open play opp six yards | Competitions | Seasons | Season | Player Forename Cleaned | Player Surname Cleaned | Player Full Name | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5431 | 2012-01-03 | 12450 | Kolo Touré | NaN | Manchester City | 43 | Liverpool | 14 | Home | 2 | 1 | 90 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 26 | 3 | 0 | 0 | 26 | 3 | 20 | 2 | 6 | 1 | 13 | 0 | 12 | 2 | 1 | 1 | 25 | 2 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0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0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 15 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 | 2011 | 0 | 0 | 0 | Premier League | 11/12 | 11/12 | Kolo | Touré | Kolo Touré |
5434 | 2011-12-26 | 12450 | Kolo Touré | NaN | Manchester City | 43 | West Bromwich Albion | 35 | Away | 2 | 1 | 90 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 75 | 4 | 0 | 0 | 75 | 4 | 50 | 1 | 25 | 3 | 23 | 1 | 50 | 2 | 2 | 1 | 65 | 1 | 10 | 3 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 97 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 1 | 0 | 1 | 4 | 0 | 2 | 0 | 0 | 8 | 6 | 2 | 0 | 1 | 4 | 16 | 0 | 0 | 2 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 | 5 | 0 | 0 | 0 | 0 | 13 | 4 | 24 | 38 | 0 | 1 | 0 | 8 | 2011 | 1 | 0 | 0 | Premier League | 11/12 | 11/12 | Kolo | Touré | Kolo Touré |
5435 | 2012-03-31 | 12450 | Kolo Touré | NaN | Manchester City | 43 | Sunderland | 56 | Home | 2 | 1 | 90 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 38 | 3 | 0 | 0 | 38 | 3 | 22 | 1 | 16 | 2 | 5 | 0 | 28 | 1 | 5 | 2 | 34 | 2 | 4 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 2 | 2 | 1 | 2 | 1 | 2 | 0 | 0 | 9 | 5 | 4 | 0 | 0 | 0 | 14 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 5 | 0 | 0 | 0 | 0 | 19 | 0 | 9 | 13 | 0 | 0 | 1 | 8 | 2011 | 5 | 2 | 0 | Premier League | 11/12 | 11/12 | Kolo | Touré | Kolo Touré |
5436 | 2011-10-15 | 12450 | Kolo Touré | NaN | Manchester City | 43 | Aston Villa | 7 | Home | 2 | 1 | 24 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 0 | 0 | 0 | 4 | 16 | 0 | 0 | 0 | 0 | 1 | 3 | 0 | 2 | 0 | 1 | 0 | 8 | 2011 | 2 | 0 | 0 | Premier League | 11/12 | 11/12 | Kolo | Touré | Kolo Touré |
5442 | 2011-11-05 | 12450 | Kolo Touré | NaN | Manchester City | 43 | Queens Park Rangers | 52 | Away | 2 | 1 | 2 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 16 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 | 2011 | 0 | 0 | 0 | Premier League | 11/12 | 11/12 | Kolo | Touré | Kolo Touré |
5443 | 2012-03-03 | 12450 | Kolo Touré | NaN | Manchester City | 43 | Bolton Wanderers | 30 | Home | 2 | 1 | 70 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 29 | 3 | 0 | 1 | 29 | 3 | 10 | 0 | 19 | 3 | 3 | 0 | 12 | 1 | 14 | 2 | 28 | 3 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 1 | 1 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 50 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 | 9 | 0 | 1 | 3 | 8 | 0 | 2 | 0 | 2 | 1 | 1 | 0 | 0 | 1 | 5 | 3 | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 5 | 17 | 0 | 2 | 0 | 0 | 9 | 8 | 3 | 12 | 0 | 1 | 0 | 8 | 2011 | 19 | 3 | 0 | Premier League | 11/12 | 11/12 | Kolo | Touré | Kolo Touré |
5444 | 2011-12-03 | 12450 | Kolo Touré | NaN | Manchester City | 43 | Norwich City | 45 | Home | 2 | 1 | 90 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 45 | 4 | 0 | 0 | 45 | 4 | 28 | 3 | 17 | 1 | 11 | 0 | 30 | 4 | 4 | 0 | 42 | 3 | 3 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 57 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 0 | 3 | 2 | 1 | 0 | 0 | 0 | 8 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 5 | 0 | 0 | 0 | 0 | 21 | 4 | 2 | 22 | 1 | 2 | 0 | 8 | 2011 | 2 | 0 | 0 | Premier League | 11/12 | 11/12 | Kolo | Touré | Kolo Touré |
# Dictionary of competitions
dict_seasons = {
2011: '11/12',
2012: '12/13',
2013: '13/14',
2014: '14/15',
2015: '15/16',
2016: '16/17',
2017: '17/18',
2018: '18/19',
2019: '19/20',
2020: '20/21',
}
# Map grouped positions to DataFrame
df_opta_mbm['Season'] = df_opta_mbm['SeasId'].map(dict_seasons)
# Dictionary of competitions
dict_comps = {
8: 'Premier League',
10: 'English Football League Championship',
14: 'Scottish Premiership',
11: 'English Football League 1',
12: 'English Football League 2',
1: 'FA Cup',
2: 'English League Cup',
7: 'English Football League Trophy',
4: 'FIFA World Cup',
5: 'Champions League',
6: 'UEFA Europa League',
20: 'J-League',
21: 'Serie A',
22: 'Bundesliga',
22: 'La Liga'
}
# Map grouped positions to DataFrame
df_opta_mbm['Competitions'] = df_opta_mbm['CompId'].map(dict_comps)
# Dictionary of competitions
dict_positions_grouped = {1: 'Goalkeeper',
2: 'Defender',
4: 'Midfielder',
6: 'Forward'
}
# Map grouped positions to DataFrame
df_opta_mbm['Position Grouped'] = df_opta_mbm['Position Id'].map(dict_positions_grouped)
# Export DataFrame as a CSV file
## Export another copy to the Opta folder called 'latest' (can be overwritten)
df_opta_mbm.to_csv(data_dir_opta + '/engineered/' + 'opta_match_by_match_pl_1112.csv', index=None, header=True)
## Export another copy to the Opta folder called 'latest' (can be overwritten)
df_opta_mbm.to_csv(data_dir + '/export/opta_match_by_match_pl_1112.csv', index=None, header=True)
df_opta_mbm.head()
Date | Player ID | Player Surname | Player Forename | Team | Team Id | Opposition | Opposition id | Venue | Position Id | Appearances | Time Played | Starts | Substitute On | Substitute Off | Goals | First Goal | Winning Goal | Shots On Target inc goals | Shots Off Target inc woodwork | Blocked Shots | Penalties Taken | Penalty Goals | Penalties Saved | Penalties Off Target | Penalties Not Scored | Direct Free-kick Goals | Direct Free-kick On Target | Direct Free-kick Off Target | Blocked Direct Free-kick | Goals from Inside Box | Shots On from Inside Box | Shots Off from Inside Box | Blocked Shots from Inside Box | Goals from Outside Box | Shots On Target Outside Box | Shots Off Target Outside Box | Blocked Shots Outside Box | Headed Goals | Headed Shots On Target | Headed Shots Off Target | Headed Blocked Shots | Left Foot Goals | Left Foot Shots On Target | Left Foot Shots Off Target | Left Foot Blocked Shots | Right Foot Goals | Right Foot Shots On Target | Right Foot Shots Off Target | Right Foot Blocked Shots | Other Goals | Other Shots On Target | Other Shots Off Target | Other Blocked Shots | Shots Cleared off Line | Shots Cleared off Line Inside Area | Shots Cleared off Line Outside Area | Goals Open Play | Goals from Corners | Goals from Throws | Goals from Direct Free Kick | Goals from Set Play | Goals from penalties | Attempts Open Play on target | Attempts from Corners on target | Attempts from Throws on target | Attempts from Direct Free Kick on target | Attempts from Set Play on target | Attempts from Penalties on target | Attempts Open Play off target | Attempts from Corners off target | Attempts from Throws off target | Attempts from Direct Free Kick off target | Attempts from Set Play off target | Attempts from Penalties off target | Goals as a substitute | Total Successful Passes All | Total Unsuccessful Passes All | Assists | Key Passes | Total Successful Passes Excl Crosses Corners | Total Unsuccessful Passes Excl Crosses Corners | Successful Passes Own Half | Unsuccessful Passes Own Half | Successful Passes Opposition Half | Unsuccessful Passes Opposition Half | Successful Passes Defensive third | Unsuccessful Passes Defensive third | Successful Passes Middle third | Unsuccessful Passes Middle third | Successful Passes Final third | Unsuccessful Passes Final third | Successful Short Passes | Unsuccessful Short Passes | Successful Long Passes | Unsuccessful Long Passes | Successful Flick-Ons | Unsuccessful Flick-Ons | Successful Crosses Corners | Unsuccessful Crosses Corners | Corners Taken incl short corners | Corners Conceded | Successful Corners into Box | Unsuccessful Corners into Box | Short Corners | Throw Ins to Own Player | Throw Ins to Opposition Player | Successful Dribbles | Unsuccessful Dribbles | Successful Crosses Corners Left | Unsuccessful Crosses Corners Left | Successful Crosses Left | Unsuccessful Crosses Left | Successful Corners Left | Unsuccessful Corners Left | Successful Crosses Corners Right | Unsuccessful Crosses Corners Right | Successful Crosses Right | Unsuccessful Crosses Right | Successful Corners Right | Unsuccessful Corners Right | Successful Long Balls | Unsuccessful Long Balls | Successful Lay-Offs | Unsuccessful Lay-Offs | Through Ball | Successful Crosses Corners in the air | Unsuccessful Crosses Corners in the air | Successful crosses in the air | Unsuccessful crosses in the air | Successful open play crosses | Unsuccessful open play crosses | Touches | Goal Assist Corner | Goal Assist Free Kick | Goal Assist Throw In | Goal Assist Goal Kick | Goal Assist Set Piece | Key Corner | Key Free Kick | Key Throw In | Key Goal Kick | Key Set Pieces | Duels won | Duels lost | Aerial Duels won | Aerial Duels lost | Ground Duels won | Ground Duels lost | Tackles Won | Tackles Lost | Last Man Tackle | Total Clearances | Headed Clearances | Other Clearances | Clearances Off the Line | Blocks | Interceptions | Recoveries | Total Fouls Conceded | Fouls Conceded exc handballs pens | Total Fouls Won | Fouls Won in Danger Area inc pens | Fouls Won not in danger area | Foul Won Penalty | Handballs Conceded | Penalties Conceded | Offsides | Yellow Cards | Red Cards | Goals Conceded | Goals Conceded Inside Box | Goals Conceded Outside Box | Saves Made | Saves Made from Inside Box | Saves Made from Outside Box | Saves from Penalty | Catches | Punches | Drops | Crosses not Claimed | GK Distribution | GK Successful Distribution | GK Unsuccessful Distribution | Clean Sheets | Team Clean sheet | Error leading to Goal | Error leading to Attempt | Challenge Lost | Shots On Conceded | Shots On Conceded Inside Box | Shots On Conceded Outside Box | Team Formation | Position in Formation | Turnovers | Dispossessed | Big Chances | Big Chances Faced | Pass Forward | Pass Backward | Pass Left | Pass Right | Unsuccessful Ball Touch | Successful Ball Touch | Take-Ons Overrun | CompId | SeasId | Touches open play final third | Touches open play opp box | Touches open play opp six yards | Competitions | Seasons | Season | Player Forename Cleaned | Player Surname Cleaned | Player Full Name | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 2012-04-28 | 28566 | Abou Dia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| 1 | 0 | 0 | 3 | 0 | 0 | 0 | 4 | 0 | 3 | 0 | 3 | 53 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 | 5 | 0 | 0 | 3 | 5 | 0 | 0 | 0 | 2 | 2 | 0 | 0 | 0 | 0 | 5 | 3 | 3 | 2 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 | 10 | 0 | 2 | 0 | 0 | 6 | 10 | 13 | 12 | 0 | 4 | 0 | 8 | 2011 | 16 | 3 | 0 | Premier League | 11/12 | 11/12 | Charlie | Adam | Charlie Adam |
# CODE HERE
df_opta_team = df_opta_mbm
# Displays all one hundered and four columns
with pd.option_context('display.max_rows', None, 'display.max_columns', None):
print(df_opta_team.dtypes)
Date object Player ID int64 Player Surname object Player Forename object Team object Team Id int64 Opposition object Opposition id int64 Venue object Position Id int64 Appearances int64 Time Played int64 Starts int64 Substitute On int64 Substitute Off int64 Goals int64 First Goal int64 Winning Goal int64 Shots On Target inc goals int64 Shots Off Target inc woodwork int64 Blocked Shots int64 Penalties Taken int64 Penalty Goals int64 Penalties Saved int64 Penalties Off Target int64 Penalties Not Scored int64 Direct Free-kick Goals int64 Direct Free-kick On Target int64 Direct Free-kick Off Target int64 Blocked Direct Free-kick int64 Goals from Inside Box int64 Shots On from Inside Box int64 Shots Off from Inside Box int64 Blocked Shots from Inside Box int64 Goals from Outside Box int64 Shots On Target Outside Box int64 Shots Off Target Outside Box int64 Blocked Shots Outside Box int64 Headed Goals int64 Headed Shots On Target int64 Headed Shots Off Target int64 Headed Blocked Shots int64 Left Foot Goals int64 Left Foot Shots On Target int64 Left Foot Shots Off Target int64 Left Foot Blocked Shots int64 Right Foot Goals int64 Right Foot Shots On Target int64 Right Foot Shots Off Target int64 Right Foot Blocked Shots int64 Other Goals int64 Other Shots On Target int64 Other Shots Off Target int64 Other Blocked Shots int64 Shots Cleared off Line int64 Shots Cleared off Line Inside Area int64 Shots Cleared off Line Outside Area int64 Goals Open Play int64 Goals from Corners int64 Goals from Throws int64 Goals from Direct Free Kick int64 Goals from Set Play int64 Goals from penalties int64 Attempts Open Play on target int64 Attempts from Corners on target int64 Attempts from Throws on target int64 Attempts from Direct Free Kick on target int64 Attempts from Set Play on target int64 Attempts from Penalties on target int64 Attempts Open Play off target int64 Attempts from Corners off target int64 Attempts from Throws off target int64 Attempts from Direct Free Kick off target int64 Attempts from Set Play off target int64 Attempts from Penalties off target int64 Goals as a substitute int64 Total Successful Passes All int64 Total Unsuccessful Passes All int64 Assists int64 Key Passes int64 Total Successful Passes Excl Crosses Corners int64 Total Unsuccessful Passes Excl Crosses Corners int64 Successful Passes Own Half int64 Unsuccessful Passes Own Half int64 Successful Passes Opposition Half int64 Unsuccessful Passes Opposition Half int64 Successful Passes Defensive third int64 Unsuccessful Passes Defensive third int64 Successful Passes Middle third int64 Unsuccessful Passes Middle third int64 Successful Passes Final third int64 Unsuccessful Passes Final third int64 Successful Short Passes int64 Unsuccessful Short Passes int64 Successful Long Passes int64 Unsuccessful Long Passes int64 Successful Flick-Ons int64 Unsuccessful Flick-Ons int64 Successful Crosses Corners int64 Unsuccessful Crosses Corners int64 Corners Taken incl short corners int64 Corners Conceded int64 Successful Corners into Box int64 Unsuccessful Corners into Box int64 Short Corners int64 Throw Ins to Own Player int64 Throw Ins to Opposition Player int64 Successful Dribbles int64 Unsuccessful Dribbles int64 Successful Crosses Corners Left int64 Unsuccessful Crosses Corners Left int64 Successful Crosses Left int64 Unsuccessful Crosses Left int64 Successful Corners Left int64 Unsuccessful Corners Left int64 Successful Crosses Corners Right int64 Unsuccessful Crosses Corners Right int64 Successful Crosses Right int64 Unsuccessful Crosses Right int64 Successful Corners Right int64 Unsuccessful Corners Right int64 Successful Long Balls int64 Unsuccessful Long Balls int64 Successful Lay-Offs int64 Unsuccessful Lay-Offs int64 Through Ball int64 Successful Crosses Corners in the air int64 Unsuccessful Crosses Corners in the air int64 Successful crosses in the air int64 Unsuccessful crosses in the air int64 Successful open play crosses int64 Unsuccessful open play crosses int64 Touches int64 Goal Assist Corner int64 Goal Assist Free Kick int64 Goal Assist Throw In int64 Goal Assist Goal Kick int64 Goal Assist Set Piece int64 Key Corner int64 Key Free Kick int64 Key Throw In int64 Key Goal Kick int64 Key Set Pieces int64 Duels won int64 Duels lost int64 Aerial Duels won int64 Aerial Duels lost int64 Ground Duels won int64 Ground Duels lost int64 Tackles Won int64 Tackles Lost int64 Last Man Tackle int64 Total Clearances int64 Headed Clearances int64 Other Clearances int64 Clearances Off the Line int64 Blocks int64 Interceptions int64 Recoveries int64 Total Fouls Conceded int64 Fouls Conceded exc handballs pens int64 Total Fouls Won int64 Fouls Won in Danger Area inc pens int64 Fouls Won not in danger area int64 Foul Won Penalty int64 Handballs Conceded int64 Penalties Conceded int64 Offsides int64 Yellow Cards int64 Red Cards int64 Goals Conceded int64 Goals Conceded Inside Box int64 Goals Conceded Outside Box int64 Saves Made int64 Saves Made from Inside Box int64 Saves Made from Outside Box int64 Saves from Penalty int64 Catches int64 Punches int64 Drops int64 Crosses not Claimed int64 GK Distribution int64 GK Successful Distribution int64 GK Unsuccessful Distribution int64 Clean Sheets int64 Team Clean sheet int64 Error leading to Goal int64 Error leading to Attempt int64 Challenge Lost int64 Shots On Conceded int64 Shots On Conceded Inside Box int64 Shots On Conceded Outside Box int64 Team Formation int64 Position in Formation int64 Turnovers int64 Dispossessed int64 Big Chances int64 Big Chances Faced int64 Pass Forward int64 Pass Backward int64 Pass Left int64 Pass Right int64 Unsuccessful Ball Touch int64 Successful Ball Touch int64 Take-Ons Overrun int64 CompId int64 SeasId int64 Touches open play final third int64 Touches open play opp box int64 Touches open play opp six yards int64 Competitions object Seasons object Season object Player Forename Cleaned object Player Surname Cleaned object Player Full Name object dtype: object
df_opta_team = df_opta_team.drop(['Date',
'Player ID',
'Player Surname',
'Player Forename',
'Opposition',
'Opposition id',
'Venue',
'Position Id',
'Player Forename Cleaned',
'Player Surname Cleaned',
'Player Full Name'
], axis=1)
df_opta_team
Team | Team Id | Appearances | Time Played | Starts | Substitute On | Substitute Off | Goals | First Goal | Winning Goal | Shots On Target inc goals | Shots Off Target inc woodwork | Blocked Shots | Penalties Taken | Penalty Goals | Penalties Saved | Penalties Off Target | Penalties Not Scored | Direct Free-kick Goals | Direct Free-kick On Target | Direct Free-kick Off Target | Blocked Direct Free-kick | Goals from Inside Box | Shots On from Inside Box | Shots Off from Inside Box | Blocked Shots from Inside Box | Goals from Outside Box | Shots On Target Outside Box | Shots Off Target Outside Box | Blocked Shots Outside Box | Headed Goals | Headed Shots On Target | Headed Shots Off Target | Headed Blocked Shots | Left Foot Goals | Left Foot Shots On Target | Left Foot Shots Off Target | Left Foot Blocked Shots | Right Foot Goals | Right Foot Shots On Target | Right Foot Shots Off Target | Right Foot Blocked Shots | Other Goals | Other Shots On Target | Other Shots Off Target | Other Blocked Shots | Shots Cleared off Line | Shots Cleared off Line Inside Area | Shots Cleared off Line Outside Area | Goals Open Play | Goals from Corners | Goals from Throws | Goals from Direct Free Kick | Goals from Set Play | Goals from penalties | Attempts Open Play on target | Attempts from Corners on target | Attempts from Throws on target | Attempts from Direct Free Kick on target | Attempts from Set Play on target | Attempts from Penalties on target | Attempts Open Play off target | Attempts from Corners off target | Attempts from Throws off target | Attempts from Direct Free Kick off target | Attempts from Set Play off target | Attempts from Penalties off target | Goals as a substitute | Total Successful Passes All | Total Unsuccessful Passes All | Assists | Key Passes | Total Successful Passes Excl Crosses Corners | Total Unsuccessful Passes Excl Crosses Corners | Successful Passes Own Half | Unsuccessful Passes Own Half | Successful Passes Opposition Half | Unsuccessful Passes Opposition Half | Successful Passes Defensive third | Unsuccessful Passes Defensive third | Successful Passes Middle third | Unsuccessful Passes Middle third | Successful Passes Final third | Unsuccessful Passes Final third | Successful Short Passes | Unsuccessful Short Passes | Successful Long Passes | Unsuccessful Long Passes | Successful Flick-Ons | Unsuccessful Flick-Ons | Successful Crosses Corners | Unsuccessful Crosses Corners | Corners Taken incl short corners | Corners Conceded | Successful Corners into Box | Unsuccessful Corners into Box | Short Corners | Throw Ins to Own Player | Throw Ins to Opposition Player | Successful Dribbles | Unsuccessful Dribbles | Successful Crosses Corners Left | Unsuccessful Crosses Corners Left | Successful Crosses Left | Unsuccessful Crosses Left | Successful Corners Left | Unsuccessful Corners Left | Successful Crosses Corners Right | Unsuccessful Crosses Corners Right | Successful Crosses Right | Unsuccessful Crosses Right | Successful Corners Right | Unsuccessful Corners Right | Successful Long Balls | Unsuccessful Long Balls | Successful Lay-Offs | Unsuccessful Lay-Offs | Through Ball | Successful Crosses Corners in the air | Unsuccessful Crosses Corners in the air | Successful crosses in the air | Unsuccessful crosses in the air | Successful open play crosses | Unsuccessful open play crosses | Touches | Goal Assist Corner | Goal Assist Free Kick | Goal Assist Throw In | Goal Assist Goal Kick | Goal Assist Set Piece | Key Corner | Key Free Kick | Key Throw In | Key Goal Kick | Key Set Pieces | Duels won | Duels lost | Aerial Duels won | Aerial Duels lost | Ground Duels won | Ground Duels lost | Tackles Won | Tackles Lost | Last Man Tackle | Total Clearances | Headed Clearances | Other Clearances | Clearances Off the Line | Blocks | Interceptions | Recoveries | Total Fouls Conceded | Fouls Conceded exc handballs pens | Total Fouls Won | Fouls Won in Danger Area inc pens | Fouls Won not in danger area | Foul Won Penalty | Handballs Conceded | Penalties Conceded | Offsides | Yellow Cards | Red Cards | Goals Conceded | Goals Conceded Inside Box | Goals Conceded Outside Box | Saves Made | Saves Made from Inside Box | Saves Made from Outside Box | Saves from Penalty | Catches | Punches | Drops | Crosses not Claimed | GK Distribution | GK Successful Distribution | GK Unsuccessful Distribution | Clean Sheets | Team Clean sheet | Error leading to Goal | Error leading to Attempt | Challenge Lost | Shots On Conceded | Shots On Conceded Inside Box | Shots On Conceded Outside Box | Team Formation | Position in Formation | Turnovers | Dispossessed | Big Chances | Big Chances Faced | Pass Forward | Pass Backward | Pass Left | Pass Right | Unsuccessful Ball Touch | Successful Ball Touch | Take-Ons Overrun | CompId | SeasId | Touches open play final third | Touches open play opp box | Touches open play opp six yards | Competitions | Seasons | Season | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | Arsenal | 3 | 1 | 17 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 1 | 0 | 0 | 10 | 1 | 2 | 0 | 8 | 1 | 0 | 0 | 7 | 0 | 3 | 1 | 10 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |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 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 30 | 11 | 0 | 0 | 30 | 7 | 13 | 1 | 17 | 6 | 5 | 1 | 17 | 3 | 8 | 3 | 24 | 6 | 6 | 1 | 0 | 0 | 0 | 4 | 3 | 0 | 0 | 1 | 2 | 2 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 0 | 3 | 0 | 1 | 0 | 0 | 3 | 0 | 0 | 0 | 4 | 0 | 3 | 0 | 3 | 53 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 | 5 | 0 | 0 | 3 | 5 | 0 | 0 | 0 | 2 | 2 | 0 | 0 | 0 | 0 | 5 | 3 | 3 | 2 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 | 10 | 0 | 2 | 0 | 0 | 6 | 10 | 13 | 12 | 0 | 4 | 0 | 8 | 2011 | 16 | 3 | 0 | Premier League | 11/12 | 11/12 |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
10364 | Tottenham Hotspur | 6 | 1 | 88 | 1 | 0 | 1 | 2 | 1 | 1 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 34 | 9 | 0 | 2 | 34 | 3 | 16 | 0 | 18 | 3 | 4 | 0 | 21 | 1 | 9 | 2 | 32 | 3 | 2 | 0 | 0 | 0 | 0 | 6 | 5 | 0 | 0 | 4 | 1 | 2 | 0 | 0 | 0 | 0 | 3 | 0 | 1 | 0 | 2 | 0 | 3 | 0 | 1 | 0 | 2 | 0 | 0 | 3 | 0 | 1 | 0 | 6 | 0 | 2 | 0 | 2 | 54 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 | 5 | 0 | 3 | 3 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 5 | 0 | 0 | 3 | 0 | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 6 | 10 | 0 | 1 | 1 | 0 | 8 | 12 | 10 | 13 | 3 | 1 | 0 | 8 | 2011 | 16 | 1 | 0 | Premier League | 11/12 | 11/12 |
10365 |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 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 10 | 0 | 0 | 0 | 0 | 7 | 4 | 7 | 11 | 1 | 0 | 0 | 8 | 2011 | 12 | 1 | 0 | Premier League | 11/12 | 11/12 |
10369 rows × 205 columns
df_opta_team = df_opta_team.groupby(['Team',
'Team Id'
]
).agg(
{
'A': 'sum'
}
).reset_index() # reset index to get grouped columns back
# Rename columns
df_opta_team.columns = ['A', 'B']
Export the engineered Events, Lineup, and Tactics Opta DataFrames as CSV files.
# Assign Raw DataFrame to Engineered DataFrame
df_opta_f24 = df_opta_f24_raw
# CODE HERE
# Import data as a DataFrame called 'df_original'. To use in wrangling process before creating 'df' DataFrame for analysis
df_pl_fixtures_1112 = pd.read_csv(data_dir_fixtures + '/Premier League/csv/season-1112.csv')
df_pl_fixtures_1112.head()
Div | Date | HomeTeam | AwayTeam | FTHG | FTAG | FTR | HTHG | HTAG | HTR | Referee | HS | AS | HST | AST | HF | AF | HC | AC | HY | AY | HR | AR | B365H | B365D | B365A | BWH | BWD | BWA | GBH | GBD | GBA | IWH | IWD | IWA | LBH | LBD | LBA | SBH | SBD | SBA | WHH | WHD | WHA | SJH | SJD | SJA | VCH | VCD | VCA | BSH | BSD | BSA | Bb1X2 | BbMxH | BbAvH | BbMxD | BbAvD | BbMxA | BbAvA | BbOU | BbMx>2.5 | BbAv>2.5 | BbMx<2.5 | BbAv<2.5 | BbAH | BbAHh | BbMxAHH | BbAvAHH | BbMxAHA | BbAvAHA | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | E0 | 13/08/11 | Blackburn | Wolves | 1 | 2 | A | 1 | 1 | D | K Friend | 16 | 13 | 8 | 4 | 14 | 10 | 12 | 6 | 4 | 2 | 0 | 0 | 2.20 | 3.20 | 3.5 | 2.00 | 3.30 | 3.60 | 2.10 | 3.20 | 3.5 | 2.0 | 3.3 | 3.3 | 2.00 | 3.40 | 3.75 | 2.0 | 3.25 | 3.40 | 2.20 | 3.10 | 3.50 | 2.05 | 3.40 | 3.60 | 2.15 | 3.4 | 3.60 | 2.00 | 3.40 | 3.60 | 37 | 2.22 | 2.13 | 3.43 | 3.29 | 3.75 | 3.52 | 37 | 2.06 | 1.96 | 1.89 | 1.82 | 18 | -0.50 | 2.20 | 2.14 | 1.78 | 1.74 |
1 | E0 | 13/08/11 | Fulham | Aston Villa | 0 | 0 | D | 0 | 0 | D | L Mason | 13 | 7 | 9 | 1 | 10 | 18 | 2 | 3 | 2 | 4 | 0 | 0 | 2.20 | 3.20 | 3.5 | 2.05 | 3.30 | 3.45 | 2.10 | 3.20 | 3.5 | 2.2 | 3.2 | 3.0 | 2.20 | 3.30 | 3.30 | 2.1 | 3.20 | 3.20 | 2.20 | 3.20 | 3.40 | 2.10 | 3.30 | 3.50 | 2.15 | 3.3 | 3.75 | 2.10 | 3.25 | 3.40 | 38 | 2.20 | 2.12 | 3.43 | 3.28 | 3.86 | 3.53 | 34 | 2.21 | 2.11 | 1.77 | 1.69 | 21 | -0.25 | 1.83 | 1.80 | 2.14 | 2.08 |
2 | E0 | 13/08/11 | Liverpool | Sunderland | 1 | 1 | D | 1 | 0 | H | P Dowd | 11 | 15 | 4 | 6 | 17 | 12 | 6 | 3 | 4 | 4 | 0 | 0 | 1.57 | 3.60 | 7.0 | 1.45 | 3.85 | 7.50 | 1.50 | 3.75 | 7.0 | 1.4 | 4.1 | 7.0 | 1.50 | 3.75 | 7.50 | 1.4 | 4.00 | 7.50 | 1.57 | 3.75 | 6.50 | 1.50 | 3.90 | 7.50 | 1.53 | 4.0 | 7.50 | 1.50 | 3.75 | 7.00 | 37 | 1.57 | 1.50 | 4.20 | 3.92 | 8.04 | 7.30 | 37 | 1.92 | 1.85 | 2.01 | 1.92 | 21 | -1.00 | 1.92 | 1.88 | 2.02 | 1.98 |
3 | E0 | 13/08/11 | Newcastle | Arsenal | 0 | 0 | D | 0 | 0 | D | P Walton | 6 | 9 | 1 | 4 | 9 | 11 | 2 | 5 | 3 | 5 | 0 | 1 | 3.75 | 3.25 | 2.1 | 3.65 | 3.25 | 2.00 | 3.75 | 3.20 | 2.0 | 3.7 | 3.3 | 1.9 | 3.75 | 3.40 | 2.00 | 3.4 | 3.40 | 1.95 | 3.75 | 3.20 | 2.05 | 4.00 | 3.50 | 1.91 | 3.80 | 3.4 | 2.10 | 3.75 | 3.25 | 2.05 | 36 | 4.00 | 3.68 | 3.52 | 3.35 | 2.15 | 2.05 | 34 | 1.89 | 1.80 | 2.10 | 1.98 | 20 | 0.50 | 1.84 | 1.79 | 2.16 | 2.10 |
4 | E0 | 13/08/11 | QPR | Bolton | 0 | 4 | A | 0 | 1 | A | M Atkinson | 13 | 13 | 7 | 7 | 9 | 16 | 3 | 2 | 1 | 2 | 1 | 0 | 2.40 | 3.25 | 3.0 | 2.25 | 3.25 | 3.05 | 2.30 | 3.20 | 3.0 | 2.3 | 3.2 | 2.8 | 2.38 | 3.25 | 3.00 | 2.3 | 3.20 | 2.80 | 2.40 | 3.10 | 3.10 | 2.30 | 3.25 | 3.20 | 2.38 | 3.3 | 3.30 | 2.30 | 3.25 | 3.10 | 37 | 2.40 | 2.30 | 3.40 | 3.26 | 3.40 | 3.14 | 34 | 2.27 | 2.16 | 1.73 | 1.66 | 19 | -0.25 | 2.00 | 1.95 | 1.98 | 1.92 |
# CODE HERE
*Visit my website EddWebster.com or my GitHub Repository for more projects. If you'd like to get in contact, my Twitter handle is @eddwebster and my email is: edd.j.webster@gmail.com.*