{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "e621e3ae", "metadata": { "nbsphinx": "hidden", "tags": [] }, "outputs": [], "source": [ "import pandas as pd\n", "\n", "pd.set_option(\"display.max_columns\", None)" ] }, { "cell_type": "code", "execution_count": 2, "id": "f5e5541b", "metadata": { "nbsphinx": "hidden", "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "env: SOCCERDATA_LOGLEVEL=ERROR\n", "env: SOCCERDATA_NOCACHE=True\n", "env: SOCCERDATA_NOSTORE=True\n" ] } ], "source": [ "%env SOCCERDATA_LOGLEVEL=ERROR\n", "%env SOCCERDATA_NOCACHE=True\n", "%env SOCCERDATA_NOSTORE=True" ] }, { "cell_type": "code", "execution_count": 3, "id": "2454afe6", "metadata": { "tags": [] }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "No entry for terminal type \"xterm-color\";\n", "using dumb terminal settings.\n" ] } ], "source": [ "import soccerdata as sd" ] }, { "cell_type": "markdown", "id": "b5784f2d", "metadata": {}, "source": [ "# FBref" ] }, { "cell_type": "code", "execution_count": 4, "id": "8dab5be9", "metadata": { "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Provides pd.DataFrames from data at http://fbref.com.\n", "\n", " Data will be downloaded as necessary and cached locally in\n", " ``~/soccerdata/data/FBref``.\n", "\n", " Parameters\n", " ----------\n", " leagues : string or iterable, optional\n", " IDs of leagues to include. For efficiently reading data from the Top-5\n", " European leagues, use \"Big 5 European Leagues Combined\".\n", " seasons : string, int or list, optional\n", " Seasons to include. Supports multiple formats.\n", " Examples: '16-17'; 2016; '2016-17'; [14, 15, 16]\n", " proxy : 'tor' or or dict or list(dict) or callable, optional\n", " Use a proxy to hide your IP address. Valid options are:\n", " - \"tor\": Uses the Tor network. Tor should be running in\n", " the background on port 9050.\n", " - str: The address of the proxy server to use.\n", " - list(str): A list of proxies to choose from. A different proxy will\n", " be selected from this list after failed requests, allowing rotating\n", " proxies.\n", " - callable: A function that returns a valid proxy. This function will\n", " be called after failed requests, allowing rotating proxies.\n", " no_cache : bool\n", " If True, will not use cached data.\n", " no_store : bool\n", " If True, will not store downloaded data.\n", " data_dir : Path\n", " Path to directory where data will be cached.\n", " path_to_browser : Path, optional\n", " Path to the Chrome executable.\n", " headless : bool, default: True\n", " If True, will run Chrome in headless mode. Setting this to False might\n", " help to avoid getting blocked. Only supported for Selenium <4.13.\n", " \n" ] } ], "source": [ "fbref = sd.FBref(leagues=\"ENG-Premier League\", seasons=2021)\n", "print(fbref.__doc__)" ] }, { "cell_type": "markdown", "id": "f791f100", "metadata": {}, "source": [ "## Team season stats" ] }, { "cell_type": "code", "execution_count": 5, "id": "4dc08db7", "metadata": { "tags": [] }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
players_used90sStandardurl
GlsShSoTSoT%Sh/90SoT/90G/ShG/SoTPKPKatt
leagueseasonteam
ENG-Premier League2021Arsenal29385345314030.911.923.680.10.3466/en/squads/18bb7c10/2020-2021/Arsenal-Stats
Aston Villa24385251417834.613.534.680.090.2656/en/squads/8602292d/2020-2021/Aston-Villa-Stats
Brighton27383947813428.012.583.530.070.2569/en/squads/d07537b9/2020-2021/Brighton-and-Hov...
Burnley25383238112432.510.033.260.080.2333/en/squads/943e8050/2020-2021/Burnley-Stats
Chelsea27385654619335.314.375.080.090.25810/en/squads/cff3d9bb/2020-2021/Chelsea-Stats
\n", "
" ], "text/plain": [ " players_used 90s Standard \\\n", " Gls Sh SoT \n", "league season team \n", "ENG-Premier League 2021 Arsenal 29 38 53 453 140 \n", " Aston Villa 24 38 52 514 178 \n", " Brighton 27 38 39 478 134 \n", " Burnley 25 38 32 381 124 \n", " Chelsea 27 38 56 546 193 \n", "\n", " \\\n", " SoT% Sh/90 SoT/90 G/Sh G/SoT PK \n", "league season team \n", "ENG-Premier League 2021 Arsenal 30.9 11.92 3.68 0.1 0.34 6 \n", " Aston Villa 34.6 13.53 4.68 0.09 0.26 5 \n", " Brighton 28.0 12.58 3.53 0.07 0.25 6 \n", " Burnley 32.5 10.03 3.26 0.08 0.23 3 \n", " Chelsea 35.3 14.37 5.08 0.09 0.25 8 \n", "\n", " \\\n", " PKatt \n", "league season team \n", "ENG-Premier League 2021 Arsenal 6 \n", " Aston Villa 6 \n", " Brighton 9 \n", " Burnley 3 \n", " Chelsea 10 \n", "\n", " url \n", " \n", "league season team \n", "ENG-Premier League 2021 Arsenal /en/squads/18bb7c10/2020-2021/Arsenal-Stats \n", " Aston Villa /en/squads/8602292d/2020-2021/Aston-Villa-Stats \n", " Brighton /en/squads/d07537b9/2020-2021/Brighton-and-Hov... \n", " Burnley /en/squads/943e8050/2020-2021/Burnley-Stats \n", " Chelsea /en/squads/cff3d9bb/2020-2021/Chelsea-Stats " ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "team_season_stats = fbref.read_team_season_stats(stat_type=\"shooting\")\n", "team_season_stats.head()" ] }, { "cell_type": "markdown", "id": "98881255-a906-4f4f-aeaa-788a46b9fcc1", "metadata": {}, "source": [ "## Team match stats" ] }, { "cell_type": "code", "execution_count": 6, "id": "168c34f5-3035-410f-bc74-51c4af9ca4d7", "metadata": { "tags": [] }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
datetimerounddayvenueresultGFGAopponentPossAttendanceCaptainFormationOpp FormationRefereematch_reportNotes
leagueseasonteamgame
ENG-Premier League2021Manchester City2020-09-21 Wolves-Manchester City2020-09-2120:15:00Matchweek 2MonAwayW31Wolves65<NA>Fernandinho4-2-3-15-3-2Andre Marriner/en/matches/1c17eca3/Wolverhampton-Wanderers-M...<NA>
2020-09-27 Manchester City-Leicester City2020-09-2716:30:00Matchweek 3SunHomeL25Leicester City72<NA>Fernandinho4-2-3-15-4-1Michael Oliver/en/matches/31c2a061/Manchester-City-Leicester...<NA>
2020-10-03 Leeds United-Manchester City2020-10-0317:30:00Matchweek 4SatAwayD11Leeds United48<NA>Kevin De Bruyne4-3-34-1-4-1Mike Dean/en/matches/5ce15b58/Leeds-United-Manchester-C...<NA>
2020-10-17 Manchester City-Arsenal2020-10-1717:30:00Matchweek 5SatHomeW10Arsenal59<NA>Raheem Sterling3-1-4-24-3-3Chris Kavanagh/en/matches/e95b8546/Manchester-City-Arsenal-O...<NA>
2020-10-24 West Ham United-Manchester City2020-10-2412:30:00Matchweek 6SatAwayD11West Ham United70<NA>Raheem Sterling4-3-35-4-1Anthony Taylor/en/matches/2b0c0eca/West-Ham-United-Mancheste...<NA>
\n", "
" ], "text/plain": [ " date \\\n", "league season team game \n", "ENG-Premier League 2021 Manchester City 2020-09-21 Wolves-Manchester City 2020-09-21 \n", " 2020-09-27 Manchester City-Leicester City 2020-09-27 \n", " 2020-10-03 Leeds United-Manchester City 2020-10-03 \n", " 2020-10-17 Manchester City-Arsenal 2020-10-17 \n", " 2020-10-24 West Ham United-Manchester City 2020-10-24 \n", "\n", " time \\\n", "league season team game \n", "ENG-Premier League 2021 Manchester City 2020-09-21 Wolves-Manchester City 20:15:00 \n", " 2020-09-27 Manchester City-Leicester City 16:30:00 \n", " 2020-10-03 Leeds United-Manchester City 17:30:00 \n", " 2020-10-17 Manchester City-Arsenal 17:30:00 \n", " 2020-10-24 West Ham United-Manchester City 12:30:00 \n", "\n", " round \\\n", "league season team game \n", "ENG-Premier League 2021 Manchester City 2020-09-21 Wolves-Manchester City Matchweek 2 \n", " 2020-09-27 Manchester City-Leicester City Matchweek 3 \n", " 2020-10-03 Leeds United-Manchester City Matchweek 4 \n", " 2020-10-17 Manchester City-Arsenal Matchweek 5 \n", " 2020-10-24 West Ham United-Manchester City Matchweek 6 \n", "\n", " day \\\n", "league season team game \n", "ENG-Premier League 2021 Manchester City 2020-09-21 Wolves-Manchester City Mon \n", " 2020-09-27 Manchester City-Leicester City Sun \n", " 2020-10-03 Leeds United-Manchester City Sat \n", " 2020-10-17 Manchester City-Arsenal Sat \n", " 2020-10-24 West Ham United-Manchester City Sat \n", "\n", " venue \\\n", "league season team game \n", "ENG-Premier League 2021 Manchester City 2020-09-21 Wolves-Manchester City Away \n", " 2020-09-27 Manchester City-Leicester City Home \n", " 2020-10-03 Leeds United-Manchester City Away \n", " 2020-10-17 Manchester City-Arsenal Home \n", " 2020-10-24 West Ham United-Manchester City Away \n", "\n", " result \\\n", "league season team game \n", "ENG-Premier League 2021 Manchester City 2020-09-21 Wolves-Manchester City W \n", " 2020-09-27 Manchester City-Leicester City L \n", " 2020-10-03 Leeds United-Manchester City D \n", " 2020-10-17 Manchester City-Arsenal W \n", " 2020-10-24 West Ham United-Manchester City D \n", "\n", " GF \\\n", "league season team game \n", "ENG-Premier League 2021 Manchester City 2020-09-21 Wolves-Manchester City 3 \n", " 2020-09-27 Manchester City-Leicester City 2 \n", " 2020-10-03 Leeds United-Manchester City 1 \n", " 2020-10-17 Manchester City-Arsenal 1 \n", " 2020-10-24 West Ham United-Manchester City 1 \n", "\n", " GA \\\n", "league season team game \n", "ENG-Premier League 2021 Manchester City 2020-09-21 Wolves-Manchester City 1 \n", " 2020-09-27 Manchester City-Leicester City 5 \n", " 2020-10-03 Leeds United-Manchester City 1 \n", " 2020-10-17 Manchester City-Arsenal 0 \n", " 2020-10-24 West Ham United-Manchester City 1 \n", "\n", " opponent \\\n", "league season team game \n", "ENG-Premier League 2021 Manchester City 2020-09-21 Wolves-Manchester City Wolves \n", " 2020-09-27 Manchester City-Leicester City Leicester City \n", " 2020-10-03 Leeds United-Manchester City Leeds United \n", " 2020-10-17 Manchester City-Arsenal Arsenal \n", " 2020-10-24 West Ham United-Manchester City West Ham United \n", "\n", " Poss \\\n", "league season team game \n", "ENG-Premier League 2021 Manchester City 2020-09-21 Wolves-Manchester City 65 \n", " 2020-09-27 Manchester City-Leicester City 72 \n", " 2020-10-03 Leeds United-Manchester City 48 \n", " 2020-10-17 Manchester City-Arsenal 59 \n", " 2020-10-24 West Ham United-Manchester City 70 \n", "\n", " Attendance \\\n", "league season team game \n", "ENG-Premier League 2021 Manchester City 2020-09-21 Wolves-Manchester City \n", " 2020-09-27 Manchester City-Leicester City \n", " 2020-10-03 Leeds United-Manchester City \n", " 2020-10-17 Manchester City-Arsenal \n", " 2020-10-24 West Ham United-Manchester City \n", "\n", " Captain \\\n", "league season team game \n", "ENG-Premier League 2021 Manchester City 2020-09-21 Wolves-Manchester City Fernandinho \n", " 2020-09-27 Manchester City-Leicester City Fernandinho \n", " 2020-10-03 Leeds United-Manchester City Kevin De Bruyne \n", " 2020-10-17 Manchester City-Arsenal Raheem Sterling \n", " 2020-10-24 West Ham United-Manchester City Raheem Sterling \n", "\n", " Formation \\\n", "league season team game \n", "ENG-Premier League 2021 Manchester City 2020-09-21 Wolves-Manchester City 4-2-3-1 \n", " 2020-09-27 Manchester City-Leicester City 4-2-3-1 \n", " 2020-10-03 Leeds United-Manchester City 4-3-3 \n", " 2020-10-17 Manchester City-Arsenal 3-1-4-2 \n", " 2020-10-24 West Ham United-Manchester City 4-3-3 \n", "\n", " Opp Formation \\\n", "league season team game \n", "ENG-Premier League 2021 Manchester City 2020-09-21 Wolves-Manchester City 5-3-2 \n", " 2020-09-27 Manchester City-Leicester City 5-4-1 \n", " 2020-10-03 Leeds United-Manchester City 4-1-4-1 \n", " 2020-10-17 Manchester City-Arsenal 4-3-3 \n", " 2020-10-24 West Ham United-Manchester City 5-4-1 \n", "\n", " Referee \\\n", "league season team game \n", "ENG-Premier League 2021 Manchester City 2020-09-21 Wolves-Manchester City Andre Marriner \n", " 2020-09-27 Manchester City-Leicester City Michael Oliver \n", " 2020-10-03 Leeds United-Manchester City Mike Dean \n", " 2020-10-17 Manchester City-Arsenal Chris Kavanagh \n", " 2020-10-24 West Ham United-Manchester City Anthony Taylor \n", "\n", " match_report \\\n", "league season team game \n", "ENG-Premier League 2021 Manchester City 2020-09-21 Wolves-Manchester City /en/matches/1c17eca3/Wolverhampton-Wanderers-M... \n", " 2020-09-27 Manchester City-Leicester City /en/matches/31c2a061/Manchester-City-Leicester... \n", " 2020-10-03 Leeds United-Manchester City /en/matches/5ce15b58/Leeds-United-Manchester-C... \n", " 2020-10-17 Manchester City-Arsenal /en/matches/e95b8546/Manchester-City-Arsenal-O... \n", " 2020-10-24 West Ham United-Manchester City /en/matches/2b0c0eca/West-Ham-United-Mancheste... \n", "\n", " Notes \n", "league season team game \n", "ENG-Premier League 2021 Manchester City 2020-09-21 Wolves-Manchester City \n", " 2020-09-27 Manchester City-Leicester City \n", " 2020-10-03 Leeds United-Manchester City \n", " 2020-10-17 Manchester City-Arsenal \n", " 2020-10-24 West Ham United-Manchester City " ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "team_match_stats = fbref.read_team_match_stats(stat_type=\"schedule\", team=\"Manchester City\")\n", "team_match_stats.head()" ] }, { "cell_type": "markdown", "id": "eb5fabf3", "metadata": {}, "source": [ "## Player season stats" ] }, { "cell_type": "code", "execution_count": 7, "id": "66ce10da", "metadata": { "tags": [] }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
nationposagebornPlaying TimePerformancePer 90 Minutes
MPStartsMin90sGlsAstG+AG-PKPKPKattCrdYCrdRGlsAstG+AG-PKG+A-PK
leagueseasonteamplayer
ENG-Premier League2021ArsenalAinsley Maitland-NilesENGMF,DF2219971154905.4000000000.00.00.00.00.0
Alexandre LacazetteFRAFW2919913122192321.4132151033300.610.090.70.470.56
Bernd LenoGERGK2819923535313134.8000000010.00.00.00.00.0
Bukayo SakaENGMF1820013230255328.4538500100.180.110.280.180.28
Calum ChambersENGDF2519951087538.4022000000.00.240.240.00.24
\n", "
" ], "text/plain": [ " nation pos age \\\n", " \n", "league season team player \n", "ENG-Premier League 2021 Arsenal Ainsley Maitland-Niles ENG MF,DF 22 \n", " Alexandre Lacazette FRA FW 29 \n", " Bernd Leno GER GK 28 \n", " Bukayo Saka ENG MF 18 \n", " Calum Chambers ENG DF 25 \n", "\n", " born Playing Time \\\n", " MP \n", "league season team player \n", "ENG-Premier League 2021 Arsenal Ainsley Maitland-Niles 1997 11 \n", " Alexandre Lacazette 1991 31 \n", " Bernd Leno 1992 35 \n", " Bukayo Saka 2001 32 \n", " Calum Chambers 1995 10 \n", "\n", " \\\n", " Starts Min 90s \n", "league season team player \n", "ENG-Premier League 2021 Arsenal Ainsley Maitland-Niles 5 490 5.4 \n", " Alexandre Lacazette 22 1923 21.4 \n", " Bernd Leno 35 3131 34.8 \n", " Bukayo Saka 30 2553 28.4 \n", " Calum Chambers 8 753 8.4 \n", "\n", " Performance \\\n", " Gls Ast G+A \n", "league season team player \n", "ENG-Premier League 2021 Arsenal Ainsley Maitland-Niles 0 0 0 \n", " Alexandre Lacazette 13 2 15 \n", " Bernd Leno 0 0 0 \n", " Bukayo Saka 5 3 8 \n", " Calum Chambers 0 2 2 \n", "\n", " \\\n", " G-PK PK PKatt CrdY \n", "league season team player \n", "ENG-Premier League 2021 Arsenal Ainsley Maitland-Niles 0 0 0 0 \n", " Alexandre Lacazette 10 3 3 3 \n", " Bernd Leno 0 0 0 0 \n", " Bukayo Saka 5 0 0 1 \n", " Calum Chambers 0 0 0 0 \n", "\n", " Per 90 Minutes \\\n", " CrdR Gls \n", "league season team player \n", "ENG-Premier League 2021 Arsenal Ainsley Maitland-Niles 0 0.0 \n", " Alexandre Lacazette 0 0.61 \n", " Bernd Leno 1 0.0 \n", " Bukayo Saka 0 0.18 \n", " Calum Chambers 0 0.0 \n", "\n", " \\\n", " Ast G+A G-PK \n", "league season team player \n", "ENG-Premier League 2021 Arsenal Ainsley Maitland-Niles 0.0 0.0 0.0 \n", " Alexandre Lacazette 0.09 0.7 0.47 \n", " Bernd Leno 0.0 0.0 0.0 \n", " Bukayo Saka 0.11 0.28 0.18 \n", " Calum Chambers 0.24 0.24 0.0 \n", "\n", " \n", " G+A-PK \n", "league season team player \n", "ENG-Premier League 2021 Arsenal Ainsley Maitland-Niles 0.0 \n", " Alexandre Lacazette 0.56 \n", " Bernd Leno 0.0 \n", " Bukayo Saka 0.28 \n", " Calum Chambers 0.24 " ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "player_season_stats = fbref.read_player_season_stats(stat_type=\"standard\")\n", "player_season_stats.head()" ] }, { "cell_type": "markdown", "id": "4e09f7de", "metadata": {}, "source": [ "## Player match stats" ] }, { "cell_type": "code", "execution_count": 9, "id": "5ef60999", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
jersey_numbernationposageminPerformancegame_id
GlsAstPKPKattShSoTCrdYCrdRFlsFldOffCrsTklWIntOGPKwonPKcon
leagueseasongameteamplayer
ENG-Premier League20212020-09-12 Crystal Palace-SouthamptonCrystal PalaceAndros Townsend10ENGRM29-05890010000001113010<NA><NA>db261cb0
Cheikhou Kouyaté8SENCB30-26690000011002100000<NA><NA>db261cb0
Eberechi Eze25ENGFW,MF22-07510000000000003000<NA><NA>db261cb0
James McArthur18SCOCM32-34190000010001200130<NA><NA>db261cb0
James McCarthy22IRLCM29-30573000000103104120<NA><NA>db261cb0
\n", "
" ], "text/plain": [ " jersey_number \\\n", " \n", "league season game team player \n", "ENG-Premier League 2021 2020-09-12 Crystal Palace-Southampton Crystal Palace Andros Townsend 10 \n", " Cheikhou Kouyaté 8 \n", " Eberechi Eze 25 \n", " James McArthur 18 \n", " James McCarthy 22 \n", "\n", " nation \\\n", " \n", "league season game team player \n", "ENG-Premier League 2021 2020-09-12 Crystal Palace-Southampton Crystal Palace Andros Townsend ENG \n", " Cheikhou Kouyaté SEN \n", " Eberechi Eze ENG \n", " James McArthur SCO \n", " James McCarthy IRL \n", "\n", " pos \\\n", " \n", "league season game team player \n", "ENG-Premier League 2021 2020-09-12 Crystal Palace-Southampton Crystal Palace Andros Townsend RM \n", " Cheikhou Kouyaté CB \n", " Eberechi Eze FW,MF \n", " James McArthur CM \n", " James McCarthy CM \n", "\n", " age \\\n", " \n", "league season game team player \n", "ENG-Premier League 2021 2020-09-12 Crystal Palace-Southampton Crystal Palace Andros Townsend 29-058 \n", " Cheikhou Kouyaté 30-266 \n", " Eberechi Eze 22-075 \n", " James McArthur 32-341 \n", " James McCarthy 29-305 \n", "\n", " min \\\n", " \n", "league season game team player \n", "ENG-Premier League 2021 2020-09-12 Crystal Palace-Southampton Crystal Palace Andros Townsend 90 \n", " Cheikhou Kouyaté 90 \n", " Eberechi Eze 10 \n", " James McArthur 90 \n", " James McCarthy 73 \n", "\n", " Performance \\\n", " Gls \n", "league season game team player \n", "ENG-Premier League 2021 2020-09-12 Crystal Palace-Southampton Crystal Palace Andros Townsend 0 \n", " Cheikhou Kouyaté 0 \n", " Eberechi Eze 0 \n", " James McArthur 0 \n", " James McCarthy 0 \n", "\n", " \\\n", " Ast \n", "league season game team player \n", "ENG-Premier League 2021 2020-09-12 Crystal Palace-Southampton Crystal Palace Andros Townsend 1 \n", " Cheikhou Kouyaté 0 \n", " Eberechi Eze 0 \n", " James McArthur 0 \n", " James McCarthy 0 \n", "\n", " \\\n", " PK \n", "league season game team player \n", "ENG-Premier League 2021 2020-09-12 Crystal Palace-Southampton Crystal Palace Andros Townsend 0 \n", " Cheikhou Kouyaté 0 \n", " Eberechi Eze 0 \n", " James McArthur 0 \n", " James McCarthy 0 \n", "\n", " \\\n", " PKatt \n", "league season game team player \n", "ENG-Premier League 2021 2020-09-12 Crystal Palace-Southampton Crystal Palace Andros Townsend 0 \n", " Cheikhou Kouyaté 0 \n", " Eberechi Eze 0 \n", " James McArthur 0 \n", " James McCarthy 0 \n", "\n", " \\\n", " Sh \n", "league season game team player \n", "ENG-Premier League 2021 2020-09-12 Crystal Palace-Southampton Crystal Palace Andros Townsend 0 \n", " Cheikhou Kouyaté 1 \n", " Eberechi Eze 0 \n", " James McArthur 1 \n", " James McCarthy 0 \n", "\n", " \\\n", " SoT \n", "league season game team player \n", "ENG-Premier League 2021 2020-09-12 Crystal Palace-Southampton Crystal Palace Andros Townsend 0 \n", " Cheikhou Kouyaté 1 \n", " Eberechi Eze 0 \n", " James McArthur 0 \n", " James McCarthy 0 \n", "\n", " \\\n", " CrdY \n", "league season game team player \n", "ENG-Premier League 2021 2020-09-12 Crystal Palace-Southampton Crystal Palace Andros Townsend 0 \n", " Cheikhou Kouyaté 0 \n", " Eberechi Eze 0 \n", " James McArthur 0 \n", " James McCarthy 1 \n", "\n", " \\\n", " CrdR \n", "league season game team player \n", "ENG-Premier League 2021 2020-09-12 Crystal Palace-Southampton Crystal Palace Andros Townsend 0 \n", " Cheikhou Kouyaté 0 \n", " Eberechi Eze 0 \n", " James McArthur 0 \n", " James McCarthy 0 \n", "\n", " \\\n", " Fls \n", "league season game team player \n", "ENG-Premier League 2021 2020-09-12 Crystal Palace-Southampton Crystal Palace Andros Townsend 1 \n", " Cheikhou Kouyaté 2 \n", " Eberechi Eze 0 \n", " James McArthur 1 \n", " James McCarthy 3 \n", "\n", " \\\n", " Fld \n", "league season game team player \n", "ENG-Premier League 2021 2020-09-12 Crystal Palace-Southampton Crystal Palace Andros Townsend 1 \n", " Cheikhou Kouyaté 1 \n", " Eberechi Eze 0 \n", " James McArthur 2 \n", " James McCarthy 1 \n", "\n", " \\\n", " Off \n", "league season game team player \n", "ENG-Premier League 2021 2020-09-12 Crystal Palace-Southampton Crystal Palace Andros Townsend 1 \n", " Cheikhou Kouyaté 0 \n", " Eberechi Eze 0 \n", " James McArthur 0 \n", " James McCarthy 0 \n", "\n", " \\\n", " Crs \n", "league season game team player \n", "ENG-Premier League 2021 2020-09-12 Crystal Palace-Southampton Crystal Palace Andros Townsend 3 \n", " Cheikhou Kouyaté 0 \n", " Eberechi Eze 3 \n", " James McArthur 0 \n", " James McCarthy 4 \n", "\n", " \\\n", " TklW \n", "league season game team player \n", "ENG-Premier League 2021 2020-09-12 Crystal Palace-Southampton Crystal Palace Andros Townsend 0 \n", " Cheikhou Kouyaté 0 \n", " Eberechi Eze 0 \n", " James McArthur 1 \n", " James McCarthy 1 \n", "\n", " \\\n", " Int \n", "league season game team player \n", "ENG-Premier League 2021 2020-09-12 Crystal Palace-Southampton Crystal Palace Andros Townsend 1 \n", " Cheikhou Kouyaté 0 \n", " Eberechi Eze 0 \n", " James McArthur 3 \n", " James McCarthy 2 \n", "\n", " \\\n", " OG \n", "league season game team player \n", "ENG-Premier League 2021 2020-09-12 Crystal Palace-Southampton Crystal Palace Andros Townsend 0 \n", " Cheikhou Kouyaté 0 \n", " Eberechi Eze 0 \n", " James McArthur 0 \n", " James McCarthy 0 \n", "\n", " \\\n", " PKwon \n", "league season game team player \n", "ENG-Premier League 2021 2020-09-12 Crystal Palace-Southampton Crystal Palace Andros Townsend \n", " Cheikhou Kouyaté \n", " Eberechi Eze \n", " James McArthur \n", " James McCarthy \n", "\n", " \\\n", " PKcon \n", "league season game team player \n", "ENG-Premier League 2021 2020-09-12 Crystal Palace-Southampton Crystal Palace Andros Townsend \n", " Cheikhou Kouyaté \n", " Eberechi Eze \n", " James McArthur \n", " James McCarthy \n", "\n", " game_id \n", " \n", "league season game team player \n", "ENG-Premier League 2021 2020-09-12 Crystal Palace-Southampton Crystal Palace Andros Townsend db261cb0 \n", " Cheikhou Kouyaté db261cb0 \n", " Eberechi Eze db261cb0 \n", " James McArthur db261cb0 \n", " James McCarthy db261cb0 " ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "player_match_stats = fbref.read_player_match_stats(stat_type=\"summary\", match_id=\"db261cb0\")\n", "player_match_stats.head()" ] }, { "cell_type": "markdown", "id": "3a4c2916", "metadata": {}, "source": [ "## Game schedule" ] }, { "cell_type": "code", "execution_count": 10, "id": "745be31a", "metadata": { "tags": [] }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
weekdaydatetimehome_teamscoreaway_teamattendancevenuerefereematch_reportnotesgame_id
leagueseasongame
ENG-Premier League20212020-09-12 Crystal Palace-Southampton1Sat2020-09-1215:00 (16:00)Crystal Palace1–0Southampton<NA>Selhurst ParkJonathan Moss/en/matches/db261cb0/Crystal-Palace-Southampto...<NA>db261cb0
2020-09-12 Fulham-Arsenal1Sat2020-09-1212:30 (13:30)Fulham0–3Arsenal<NA>Craven CottageChris Kavanagh/en/matches/bf52349b/Fulham-Arsenal-September-...<NA>bf52349b
2020-09-12 Liverpool-Leeds United1Sat2020-09-1217:30 (18:30)Liverpool4–3Leeds United<NA>AnfieldMichael Oliver/en/matches/21b58926/Liverpool-Leeds-United-Se...<NA>21b58926
2020-09-12 West Ham United-Newcastle United1Sat2020-09-1220:00 (21:00)West Ham United0–2Newcastle United<NA>London StadiumStuart Attwell/en/matches/78495ced/West-Ham-United-Newcastle...<NA>78495ced
2020-09-13 Tottenham Hotspur-Everton1Sun2020-09-1316:30 (17:30)Tottenham Hotspur0–1Everton<NA>Tottenham Hotspur StadiumMartin Atkinson/en/matches/fc7f9aa1/Tottenham-Hotspur-Everton...<NA>fc7f9aa1
\n", "
" ], "text/plain": [ " week \\\n", "league season game \n", "ENG-Premier League 2021 2020-09-12 Crystal Palace-Southampton 1 \n", " 2020-09-12 Fulham-Arsenal 1 \n", " 2020-09-12 Liverpool-Leeds United 1 \n", " 2020-09-12 West Ham United-Newcastle United 1 \n", " 2020-09-13 Tottenham Hotspur-Everton 1 \n", "\n", " day \\\n", "league season game \n", "ENG-Premier League 2021 2020-09-12 Crystal Palace-Southampton Sat \n", " 2020-09-12 Fulham-Arsenal Sat \n", " 2020-09-12 Liverpool-Leeds United Sat \n", " 2020-09-12 West Ham United-Newcastle United Sat \n", " 2020-09-13 Tottenham Hotspur-Everton Sun \n", "\n", " date \\\n", "league season game \n", "ENG-Premier League 2021 2020-09-12 Crystal Palace-Southampton 2020-09-12 \n", " 2020-09-12 Fulham-Arsenal 2020-09-12 \n", " 2020-09-12 Liverpool-Leeds United 2020-09-12 \n", " 2020-09-12 West Ham United-Newcastle United 2020-09-12 \n", " 2020-09-13 Tottenham Hotspur-Everton 2020-09-13 \n", "\n", " time \\\n", "league season game \n", "ENG-Premier League 2021 2020-09-12 Crystal Palace-Southampton 15:00 (16:00) \n", " 2020-09-12 Fulham-Arsenal 12:30 (13:30) \n", " 2020-09-12 Liverpool-Leeds United 17:30 (18:30) \n", " 2020-09-12 West Ham United-Newcastle United 20:00 (21:00) \n", " 2020-09-13 Tottenham Hotspur-Everton 16:30 (17:30) \n", "\n", " home_team \\\n", "league season game \n", "ENG-Premier League 2021 2020-09-12 Crystal Palace-Southampton Crystal Palace \n", " 2020-09-12 Fulham-Arsenal Fulham \n", " 2020-09-12 Liverpool-Leeds United Liverpool \n", " 2020-09-12 West Ham United-Newcastle United West Ham United \n", " 2020-09-13 Tottenham Hotspur-Everton Tottenham Hotspur \n", "\n", " score \\\n", "league season game \n", "ENG-Premier League 2021 2020-09-12 Crystal Palace-Southampton 1–0 \n", " 2020-09-12 Fulham-Arsenal 0–3 \n", " 2020-09-12 Liverpool-Leeds United 4–3 \n", " 2020-09-12 West Ham United-Newcastle United 0–2 \n", " 2020-09-13 Tottenham Hotspur-Everton 0–1 \n", "\n", " away_team \\\n", "league season game \n", "ENG-Premier League 2021 2020-09-12 Crystal Palace-Southampton Southampton \n", " 2020-09-12 Fulham-Arsenal Arsenal \n", " 2020-09-12 Liverpool-Leeds United Leeds United \n", " 2020-09-12 West Ham United-Newcastle United Newcastle United \n", " 2020-09-13 Tottenham Hotspur-Everton Everton \n", "\n", " attendance \\\n", "league season game \n", "ENG-Premier League 2021 2020-09-12 Crystal Palace-Southampton \n", " 2020-09-12 Fulham-Arsenal \n", " 2020-09-12 Liverpool-Leeds United \n", " 2020-09-12 West Ham United-Newcastle United \n", " 2020-09-13 Tottenham Hotspur-Everton \n", "\n", " venue \\\n", "league season game \n", "ENG-Premier League 2021 2020-09-12 Crystal Palace-Southampton Selhurst Park \n", " 2020-09-12 Fulham-Arsenal Craven Cottage \n", " 2020-09-12 Liverpool-Leeds United Anfield \n", " 2020-09-12 West Ham United-Newcastle United London Stadium \n", " 2020-09-13 Tottenham Hotspur-Everton Tottenham Hotspur Stadium \n", "\n", " referee \\\n", "league season game \n", "ENG-Premier League 2021 2020-09-12 Crystal Palace-Southampton Jonathan Moss \n", " 2020-09-12 Fulham-Arsenal Chris Kavanagh \n", " 2020-09-12 Liverpool-Leeds United Michael Oliver \n", " 2020-09-12 West Ham United-Newcastle United Stuart Attwell \n", " 2020-09-13 Tottenham Hotspur-Everton Martin Atkinson \n", "\n", " match_report \\\n", "league season game \n", "ENG-Premier League 2021 2020-09-12 Crystal Palace-Southampton /en/matches/db261cb0/Crystal-Palace-Southampto... \n", " 2020-09-12 Fulham-Arsenal /en/matches/bf52349b/Fulham-Arsenal-September-... \n", " 2020-09-12 Liverpool-Leeds United /en/matches/21b58926/Liverpool-Leeds-United-Se... \n", " 2020-09-12 West Ham United-Newcastle United /en/matches/78495ced/West-Ham-United-Newcastle... \n", " 2020-09-13 Tottenham Hotspur-Everton /en/matches/fc7f9aa1/Tottenham-Hotspur-Everton... \n", "\n", " notes \\\n", "league season game \n", "ENG-Premier League 2021 2020-09-12 Crystal Palace-Southampton \n", " 2020-09-12 Fulham-Arsenal \n", " 2020-09-12 Liverpool-Leeds United \n", " 2020-09-12 West Ham United-Newcastle United \n", " 2020-09-13 Tottenham Hotspur-Everton \n", "\n", " game_id \n", "league season game \n", "ENG-Premier League 2021 2020-09-12 Crystal Palace-Southampton db261cb0 \n", " 2020-09-12 Fulham-Arsenal bf52349b \n", " 2020-09-12 Liverpool-Leeds United 21b58926 \n", " 2020-09-12 West Ham United-Newcastle United 78495ced \n", " 2020-09-13 Tottenham Hotspur-Everton fc7f9aa1 " ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "epl_schedule = fbref.read_schedule()\n", "epl_schedule.head()" ] }, { "cell_type": "markdown", "id": "5d370c30", "metadata": {}, "source": [ "## Line ups" ] }, { "cell_type": "code", "execution_count": 11, "id": "49a7f057", "metadata": { "tags": [] }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
jersey_numberplayerteamis_starterpositionminutes_played
leagueseasongame
ENG-Premier League20212020-09-12 Crystal Palace-Southampton31Vicente GuaitaCrystal PalaceTrueGK90
2020-09-12 Crystal Palace-Southampton2Joel WardCrystal PalaceTrueRB90
2020-09-12 Crystal Palace-Southampton6Scott DannCrystal PalaceTrueCB90
2020-09-12 Crystal Palace-Southampton8Cheikhou KouyatéCrystal PalaceTrueCB90
2020-09-12 Crystal Palace-Southampton9Jordan AyewCrystal PalaceTrueFW90
\n", "
" ], "text/plain": [ " jersey_number \\\n", "league season game \n", "ENG-Premier League 2021 2020-09-12 Crystal Palace-Southampton 31 \n", " 2020-09-12 Crystal Palace-Southampton 2 \n", " 2020-09-12 Crystal Palace-Southampton 6 \n", " 2020-09-12 Crystal Palace-Southampton 8 \n", " 2020-09-12 Crystal Palace-Southampton 9 \n", "\n", " player \\\n", "league season game \n", "ENG-Premier League 2021 2020-09-12 Crystal Palace-Southampton Vicente Guaita \n", " 2020-09-12 Crystal Palace-Southampton Joel Ward \n", " 2020-09-12 Crystal Palace-Southampton Scott Dann \n", " 2020-09-12 Crystal Palace-Southampton Cheikhou Kouyaté \n", " 2020-09-12 Crystal Palace-Southampton Jordan Ayew \n", "\n", " team \\\n", "league season game \n", "ENG-Premier League 2021 2020-09-12 Crystal Palace-Southampton Crystal Palace \n", " 2020-09-12 Crystal Palace-Southampton Crystal Palace \n", " 2020-09-12 Crystal Palace-Southampton Crystal Palace \n", " 2020-09-12 Crystal Palace-Southampton Crystal Palace \n", " 2020-09-12 Crystal Palace-Southampton Crystal Palace \n", "\n", " is_starter \\\n", "league season game \n", "ENG-Premier League 2021 2020-09-12 Crystal Palace-Southampton True \n", " 2020-09-12 Crystal Palace-Southampton True \n", " 2020-09-12 Crystal Palace-Southampton True \n", " 2020-09-12 Crystal Palace-Southampton True \n", " 2020-09-12 Crystal Palace-Southampton True \n", "\n", " position \\\n", "league season game \n", "ENG-Premier League 2021 2020-09-12 Crystal Palace-Southampton GK \n", " 2020-09-12 Crystal Palace-Southampton RB \n", " 2020-09-12 Crystal Palace-Southampton CB \n", " 2020-09-12 Crystal Palace-Southampton CB \n", " 2020-09-12 Crystal Palace-Southampton FW \n", "\n", " minutes_played \n", "league season game \n", "ENG-Premier League 2021 2020-09-12 Crystal Palace-Southampton 90 \n", " 2020-09-12 Crystal Palace-Southampton 90 \n", " 2020-09-12 Crystal Palace-Southampton 90 \n", " 2020-09-12 Crystal Palace-Southampton 90 \n", " 2020-09-12 Crystal Palace-Southampton 90 " ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "lineups = fbref.read_lineup(match_id=\"db261cb0\")\n", "lineups.head()" ] }, { "cell_type": "markdown", "id": "80192627-a42b-4f59-bf00-eb79bbce49ce", "metadata": {}, "source": [ "## Events" ] }, { "cell_type": "code", "execution_count": 12, "id": "4a80b3ac-27af-46ec-8a2b-520b082c7a45", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
teamminutescoreplayer1player2event_type
leagueseasongame
ENG-Premier League20212020-09-12 Crystal Palace-SouthamptonCrystal Palace13’1:0Wilfried ZahaAndros Townsendgoal
2020-09-12 Crystal Palace-SouthamptonCrystal Palace41’1:0Jeffrey SchluppNoneyellow_card
2020-09-12 Crystal Palace-SouthamptonSouthampton46’1:0Jannik VestergaardJan Bednareksubstitute_in
2020-09-12 Crystal Palace-SouthamptonSouthampton51’1:0Kyle Walker-PetersNoneyellow_card
2020-09-12 Crystal Palace-SouthamptonCrystal Palace58’1:0James McCarthyNoneyellow_card
\n", "
" ], "text/plain": [ " team \\\n", "league season game \n", "ENG-Premier League 2021 2020-09-12 Crystal Palace-Southampton Crystal Palace \n", " 2020-09-12 Crystal Palace-Southampton Crystal Palace \n", " 2020-09-12 Crystal Palace-Southampton Southampton \n", " 2020-09-12 Crystal Palace-Southampton Southampton \n", " 2020-09-12 Crystal Palace-Southampton Crystal Palace \n", "\n", " minute score \\\n", "league season game \n", "ENG-Premier League 2021 2020-09-12 Crystal Palace-Southampton 13’ 1:0 \n", " 2020-09-12 Crystal Palace-Southampton 41’ 1:0 \n", " 2020-09-12 Crystal Palace-Southampton 46’ 1:0 \n", " 2020-09-12 Crystal Palace-Southampton 51’ 1:0 \n", " 2020-09-12 Crystal Palace-Southampton 58’ 1:0 \n", "\n", " player1 \\\n", "league season game \n", "ENG-Premier League 2021 2020-09-12 Crystal Palace-Southampton Wilfried Zaha \n", " 2020-09-12 Crystal Palace-Southampton Jeffrey Schlupp \n", " 2020-09-12 Crystal Palace-Southampton Jannik Vestergaard \n", " 2020-09-12 Crystal Palace-Southampton Kyle Walker-Peters \n", " 2020-09-12 Crystal Palace-Southampton James McCarthy \n", "\n", " player2 \\\n", "league season game \n", "ENG-Premier League 2021 2020-09-12 Crystal Palace-Southampton Andros Townsend \n", " 2020-09-12 Crystal Palace-Southampton None \n", " 2020-09-12 Crystal Palace-Southampton Jan Bednarek \n", " 2020-09-12 Crystal Palace-Southampton None \n", " 2020-09-12 Crystal Palace-Southampton None \n", "\n", " event_type \n", "league season game \n", "ENG-Premier League 2021 2020-09-12 Crystal Palace-Southampton goal \n", " 2020-09-12 Crystal Palace-Southampton yellow_card \n", " 2020-09-12 Crystal Palace-Southampton substitute_in \n", " 2020-09-12 Crystal Palace-Southampton yellow_card \n", " 2020-09-12 Crystal Palace-Southampton yellow_card " ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "events = fbref.read_events(match_id=\"db261cb0\")\n", "events.head()" ] } ], "metadata": { "kernelspec": { "display_name": "/home/pieterr/Jupiter/Projects/soccerdata", "language": "python", "name": "soccerdata" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.12.1" }, "toc": { "base_numbering": 1, "nav_menu": {}, "number_sections": true, "sideBar": true, "skip_h1_title": false, "title_cell": "Table of Contents", "title_sidebar": "Contents", "toc_cell": false, "toc_position": {}, "toc_section_display": true, "toc_window_display": true } }, "nbformat": 4, "nbformat_minor": 5 }