sportowe_wizualizacja/shot_mapping.ipynb

628 lines
30 KiB
Plaintext
Raw Normal View History

2019-06-03 13:31:10 +02:00
{
"cells": [
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"import numpy as np\n",
"from pandas.io.json import json_normalize #package for flattening json in pandas df\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>bad_behaviour</th>\n",
" <th>ball_receipt</th>\n",
" <th>ball_recovery</th>\n",
" <th>block</th>\n",
" <th>dribble</th>\n",
" <th>duel</th>\n",
" <th>duration</th>\n",
" <th>foul_committed</th>\n",
" <th>foul_won</th>\n",
" <th>goalkeeper</th>\n",
" <th>...</th>\n",
" <th>possession_team</th>\n",
" <th>related_events</th>\n",
" <th>second</th>\n",
" <th>shot</th>\n",
" <th>substitution</th>\n",
" <th>tactics</th>\n",
" <th>team</th>\n",
" <th>timestamp</th>\n",
" <th>type</th>\n",
" <th>under_pressure</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>0.00</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>...</td>\n",
" <td>{'id': 746, 'name': 'Manchester City WFC'}</td>\n",
" <td>NaN</td>\n",
" <td>0</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>{'formation': 433, 'lineup': [{'player': {'id'...</td>\n",
" <td>{'id': 746, 'name': 'Manchester City WFC'}</td>\n",
" <td>2018-11-30 00:00:00.000</td>\n",
" <td>{'id': 35, 'name': 'Starting XI'}</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>0.00</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>...</td>\n",
" <td>{'id': 746, 'name': 'Manchester City WFC'}</td>\n",
" <td>NaN</td>\n",
" <td>0</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>{'formation': 352, 'lineup': [{'player': {'id'...</td>\n",
" <td>{'id': 971, 'name': 'Chelsea LFC'}</td>\n",
" <td>2018-11-30 00:00:00.000</td>\n",
" <td>{'id': 35, 'name': 'Starting XI'}</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>8.16</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>...</td>\n",
" <td>{'id': 746, 'name': 'Manchester City WFC'}</td>\n",
" <td>[c771a4d4-51cb-41de-83aa-7103cd199c92]</td>\n",
" <td>0</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>{'id': 971, 'name': 'Chelsea LFC'}</td>\n",
" <td>2018-11-30 00:00:00.000</td>\n",
" <td>{'id': 18, 'name': 'Half Start'}</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>7.96</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>...</td>\n",
" <td>{'id': 746, 'name': 'Manchester City WFC'}</td>\n",
" <td>[48b94b06-ebbd-47e9-958c-44bf63622f5e]</td>\n",
" <td>0</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>{'id': 746, 'name': 'Manchester City WFC'}</td>\n",
" <td>2018-11-30 00:00:00.000</td>\n",
" <td>{'id': 18, 'name': 'Half Start'}</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>0.00</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>...</td>\n",
" <td>{'id': 971, 'name': 'Chelsea LFC'}</td>\n",
" <td>[237cac8c-5cb0-4015-9d08-c7df9699a136]</td>\n",
" <td>0</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>{'id': 971, 'name': 'Chelsea LFC'}</td>\n",
" <td>2018-11-30 00:00:00.100</td>\n",
" <td>{'id': 30, 'name': 'Pass'}</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>5 rows × 33 columns</p>\n",
"</div>"
],
"text/plain": [
" bad_behaviour ball_receipt ball_recovery block dribble duel duration \\\n",
"0 NaN NaN NaN NaN NaN NaN 0.00 \n",
"1 NaN NaN NaN NaN NaN NaN 0.00 \n",
"2 NaN NaN NaN NaN NaN NaN 8.16 \n",
"3 NaN NaN NaN NaN NaN NaN 7.96 \n",
"4 NaN NaN NaN NaN NaN NaN 0.00 \n",
"\n",
" foul_committed foul_won goalkeeper ... \\\n",
"0 NaN NaN NaN ... \n",
"1 NaN NaN NaN ... \n",
"2 NaN NaN NaN ... \n",
"3 NaN NaN NaN ... \n",
"4 NaN NaN NaN ... \n",
"\n",
" possession_team \\\n",
"0 {'id': 746, 'name': 'Manchester City WFC'} \n",
"1 {'id': 746, 'name': 'Manchester City WFC'} \n",
"2 {'id': 746, 'name': 'Manchester City WFC'} \n",
"3 {'id': 746, 'name': 'Manchester City WFC'} \n",
"4 {'id': 971, 'name': 'Chelsea LFC'} \n",
"\n",
" related_events second shot substitution \\\n",
"0 NaN 0 NaN NaN \n",
"1 NaN 0 NaN NaN \n",
"2 [c771a4d4-51cb-41de-83aa-7103cd199c92] 0 NaN NaN \n",
"3 [48b94b06-ebbd-47e9-958c-44bf63622f5e] 0 NaN NaN \n",
"4 [237cac8c-5cb0-4015-9d08-c7df9699a136] 0 NaN NaN \n",
"\n",
" tactics \\\n",
"0 {'formation': 433, 'lineup': [{'player': {'id'... \n",
"1 {'formation': 352, 'lineup': [{'player': {'id'... \n",
"2 NaN \n",
"3 NaN \n",
"4 NaN \n",
"\n",
" team timestamp \\\n",
"0 {'id': 746, 'name': 'Manchester City WFC'} 2018-11-30 00:00:00.000 \n",
"1 {'id': 971, 'name': 'Chelsea LFC'} 2018-11-30 00:00:00.000 \n",
"2 {'id': 971, 'name': 'Chelsea LFC'} 2018-11-30 00:00:00.000 \n",
"3 {'id': 746, 'name': 'Manchester City WFC'} 2018-11-30 00:00:00.000 \n",
"4 {'id': 971, 'name': 'Chelsea LFC'} 2018-11-30 00:00:00.100 \n",
"\n",
" type under_pressure \n",
"0 {'id': 35, 'name': 'Starting XI'} NaN \n",
"1 {'id': 35, 'name': 'Starting XI'} NaN \n",
"2 {'id': 18, 'name': 'Half Start'} NaN \n",
"3 {'id': 18, 'name': 'Half Start'} NaN \n",
"4 {'id': 30, 'name': 'Pass'} NaN \n",
"\n",
"[5 rows x 33 columns]"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df = pd.read_json(r\"C:\\Users\\Koushik\\Downloads\\open-data-master\\open-data-master\\data\\events\\7298.json\")\n",
"df.head()"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
"shot = df[(df.possession_team =={'id': 971, 'name': 'Chelsea LFC'}) & (df.type == {'id': 16, 'name': 'Shot'})] \n",
"#change possession_team to get shots by a different team"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"scrolled": true
},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
"df_2 = pd.DataFrame(shot.location)\n",
"df_2[['X_axis','Y_axis']] = pd.DataFrame(shot.location.values.tolist(), index= shot.location.index) #df_2 has the x,y coordinate"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>location</th>\n",
" <th>X_axis</th>\n",
" <th>Y_axis</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>33</th>\n",
" <td>[115.0, 25.0]</td>\n",
" <td>115.0</td>\n",
" <td>25.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>186</th>\n",
" <td>[109.0, 51.0]</td>\n",
" <td>109.0</td>\n",
" <td>51.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>192</th>\n",
" <td>[99.0, 52.0]</td>\n",
" <td>99.0</td>\n",
" <td>52.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>196</th>\n",
" <td>[107.0, 40.0]</td>\n",
" <td>107.0</td>\n",
" <td>40.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>204</th>\n",
" <td>[108.0, 32.0]</td>\n",
" <td>108.0</td>\n",
" <td>32.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>583</th>\n",
" <td>[108.0, 32.0]</td>\n",
" <td>108.0</td>\n",
" <td>32.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>695</th>\n",
" <td>[87.0, 41.0]</td>\n",
" <td>87.0</td>\n",
" <td>41.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>749</th>\n",
" <td>[108.0, 36.0]</td>\n",
" <td>108.0</td>\n",
" <td>36.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>765</th>\n",
" <td>[105.0, 43.0]</td>\n",
" <td>105.0</td>\n",
" <td>43.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1060</th>\n",
" <td>[112.0, 39.0]</td>\n",
" <td>112.0</td>\n",
" <td>39.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1176</th>\n",
" <td>[115.0, 54.0]</td>\n",
" <td>115.0</td>\n",
" <td>54.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1179</th>\n",
" <td>[102.0, 34.0]</td>\n",
" <td>102.0</td>\n",
" <td>34.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1291</th>\n",
" <td>[108.0, 47.0]</td>\n",
" <td>108.0</td>\n",
" <td>47.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1400</th>\n",
" <td>[94.0, 54.0]</td>\n",
" <td>94.0</td>\n",
" <td>54.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1486</th>\n",
" <td>[108.0, 27.0]</td>\n",
" <td>108.0</td>\n",
" <td>27.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1622</th>\n",
" <td>[114.0, 34.0]</td>\n",
" <td>114.0</td>\n",
" <td>34.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1666</th>\n",
" <td>[109.0, 39.0]</td>\n",
" <td>109.0</td>\n",
" <td>39.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1828</th>\n",
" <td>[117.0, 31.0]</td>\n",
" <td>117.0</td>\n",
" <td>31.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2136</th>\n",
" <td>[91.0, 52.0]</td>\n",
" <td>91.0</td>\n",
" <td>52.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2240</th>\n",
" <td>[118.0, 39.0]</td>\n",
" <td>118.0</td>\n",
" <td>39.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2325</th>\n",
" <td>[111.0, 32.0]</td>\n",
" <td>111.0</td>\n",
" <td>32.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2692</th>\n",
" <td>[107.0, 47.0]</td>\n",
" <td>107.0</td>\n",
" <td>47.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2695</th>\n",
" <td>[110.0, 36.0]</td>\n",
" <td>110.0</td>\n",
" <td>36.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2813</th>\n",
" <td>[113.0, 42.0]</td>\n",
" <td>113.0</td>\n",
" <td>42.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2820</th>\n",
" <td>[109.0, 52.0]</td>\n",
" <td>109.0</td>\n",
" <td>52.0</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" location X_axis Y_axis\n",
"33 [115.0, 25.0] 115.0 25.0\n",
"186 [109.0, 51.0] 109.0 51.0\n",
"192 [99.0, 52.0] 99.0 52.0\n",
"196 [107.0, 40.0] 107.0 40.0\n",
"204 [108.0, 32.0] 108.0 32.0\n",
"583 [108.0, 32.0] 108.0 32.0\n",
"695 [87.0, 41.0] 87.0 41.0\n",
"749 [108.0, 36.0] 108.0 36.0\n",
"765 [105.0, 43.0] 105.0 43.0\n",
"1060 [112.0, 39.0] 112.0 39.0\n",
"1176 [115.0, 54.0] 115.0 54.0\n",
"1179 [102.0, 34.0] 102.0 34.0\n",
"1291 [108.0, 47.0] 108.0 47.0\n",
"1400 [94.0, 54.0] 94.0 54.0\n",
"1486 [108.0, 27.0] 108.0 27.0\n",
"1622 [114.0, 34.0] 114.0 34.0\n",
"1666 [109.0, 39.0] 109.0 39.0\n",
"1828 [117.0, 31.0] 117.0 31.0\n",
"2136 [91.0, 52.0] 91.0 52.0\n",
"2240 [118.0, 39.0] 118.0 39.0\n",
"2325 [111.0, 32.0] 111.0 32.0\n",
"2692 [107.0, 47.0] 107.0 47.0\n",
"2695 [110.0, 36.0] 110.0 36.0\n",
"2813 [113.0, 42.0] 113.0 42.0\n",
"2820 [109.0, 52.0] 109.0 52.0"
]
},
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df_2"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
"x_axis = df_2.X_axis.values.tolist()\n",
"y_axis = df_2.Y_axis.values.tolist()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n",
"from scipy.misc import imread\n",
"import matplotlib.cbook as cbook"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[<matplotlib.lines.Line2D at 0x1fb7567e630>]"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXEAAAD8CAYAAACB3pQWAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAAIABJREFUeJzt3X+UVXW9//HnG2ZGB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viDqOsVVdXc99990VW8m5Lly5deOutt+jXrx979uyJJYaDhZmFOxZRy4iFZlBRkVmmfNo4FRtD9tRTT3HHHXewcuXKuEMpO/Pnz8fMaGxsTMRfPOvWreO8886jb9++cYdSdpqbm+nZsyfuTlNTUzgHbZlKrWXAq337MsuWKdVSmsjj/59Qhq677jqGDBkSdxhlZ+zYsTz99NNxh/ERS5Ys4cwzz9RfXyEbP348r732WrgHzTaVWosUTxunJB6RvXv3Ul1dzZYtW+IOpSyYGe6eyGZ+s2bNYvLkyeGVGA9yV199NTNnzgz/r622RiZM0ciFrSmJR6ixsZGf/vSnapZWpE984hMtHccSa8GCBfTp0yfuMFLPzBg7diyHH354+Advqyt9irrat6YkHrG7776bzp07xx1Gal1++eW8+eabcYeRl82bN1NZWRl3GKk1bNgw9u3bx8CBA6M5QbbREVukeJREJfESaGxsZOzYsXGHkTo7d+7ks5/9bKpme9q1axd1dXVxh5E6GzZs4NZbb432gXXr0REBOnbMLMMafTEmSuIl8vDDD8cdQup
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"img = plt.imread(r'C:\\Users\\Koushik\\Downloads\\football_field.png')\n",
"fig, ax = plt.subplots()\n",
"\n",
"ax.imshow(img, extent=[0, 120, 0, 80])\n",
"ax.plot(x_axis,y_axis,'ro')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
}
},
"nbformat": 4,
"nbformat_minor": 2
}