sportowe_wizualizacja/11tegen11gif.ipynb
2019-10-12 13:36:27 +05:30

1135 lines
86 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "11tegen11gif.ipynb",
"provenance": [],
"collapsed_sections": []
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
}
},
"cells": [
{
"cell_type": "code",
"metadata": {
"id": "9PUEaHPDlLi5",
"colab_type": "code",
"outputId": "10d7d0a5-2b22-4100-90bf-fbb43744fb85",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 153
}
},
"source": [
"!git clone https://github.com/statsbomb/open-data.git"
],
"execution_count": 1,
"outputs": [
{
"output_type": "stream",
"text": [
"Cloning into 'open-data'...\n",
"remote: Enumerating objects: 600, done.\u001b[K\n",
"remote: Counting objects: 100% (600/600), done.\u001b[K\n",
"remote: Compressing objects: 100% (271/271), done.\u001b[K\n",
"remote: Total 6950 (delta 519), reused 407 (delta 326), pack-reused 6350\u001b[K\n",
"Receiving objects: 100% (6950/6950), 729.86 MiB | 24.95 MiB/s, done.\n",
"Resolving deltas: 100% (6161/6161), done.\n",
"Checking out files: 100% (1273/1273), done.\n"
],
"name": "stdout"
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "p_6BurGVpHeE",
"colab_type": "code",
"colab": {}
},
"source": [
"#edit only this tab\n",
"#give the folder path of the match\n",
"path = \"/content/open-data/data/events/\"\n",
"home_team = 'Espanyol'\n",
"away_team = 'Barcelona'"
],
"execution_count": 0,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "HaXB1D8ipuyY",
"colab_type": "code",
"outputId": "6bc862c3-96e4-4650-a1f3-544cd0916661",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 34
}
},
"source": [
"import PIL\n",
"import imageio\n",
"from IPython import display\n",
"import json\n",
"import os\n",
"import codecs\n",
"from pandas.io.json import json_normalize\n",
"import numpy as np\n",
"#import seaborn as sns\n",
"import pandas as pd\n",
"import matplotlib.pyplot as plt\n",
"from matplotlib.patches import Arc, Rectangle, ConnectionPatch\n",
"from matplotlib.offsetbox import OffsetImage\n",
"#import squarify\n",
"from functools import reduce\n",
"\n",
"Xg_req = pd.DataFrame(data=None)\n",
"for filename in (os.listdir(path)):\n",
" #print(filename)\n",
" filename = '69275.json' # remove the comment line to work for this match\n",
"with codecs.open(\"%s\" % path + filename,encoding='utf-8') as data_file: \n",
" data = json.load(data_file)\n",
" df = pd.DataFrame(data=None)\n",
" \n",
" df = json_normalize(data, sep = \"_\")\n",
" \n",
" #df = df[(df['type_name'] == \"Shot\")]\n",
" #df = df.loc[:,['location','shot_body_part_id','shot_end_location','shot_one_on_one','shot_technique_id','shot_type_id','under_pressure','shot_outcome_id']]\n",
" #print(df.shape)\n",
"Xg_req = Xg_req.append(df,ignore_index=True,sort=False)\n",
" #df.drop(df.index, inplace=True)\n",
" \n",
"print(\"done\")\n",
"df = Xg_req"
],
"execution_count": 85,
"outputs": [
{
"output_type": "stream",
"text": [
"done\n"
],
"name": "stdout"
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "Hs2plpAcqXNm",
"colab_type": "code",
"colab": {}
},
"source": [
"#type_id=30 is pass event AND type_id=19 is substitution event\n",
"\n",
"pass_m = df.query('type_id == 30')\n",
"substitution = df.query('type_id == 19')\n",
"#pass_m = df.query('type_name == pass')\n"
],
"execution_count": 0,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "lJEuZAIfqcbR",
"colab_type": "code",
"outputId": "826f8fd3-1399-4f2f-bcda-0e9bd77f85ee",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 51
}
},
"source": [
"#this cell is WIP\n",
"substitution_home = set()\n",
"substitution_home = substitution[substitution.team_name == home_team]\n",
"substitution_home = substitution_home['substitution_replacement_name'].unique()\n",
"substitution_away = set()\n",
"substitution_away = substitution[substitution.team_name == away_team]\n",
"substitution_away = substitution_away['substitution_replacement_name'].unique()\n",
"print(substitution_away)\n",
"print(substitution_home)"
],
"execution_count": 87,
"outputs": [
{
"output_type": "stream",
"text": [
"['Javier Alejandro Mascherano' 'Seydou Kéita' 'Bojan Krkíc Pérez']\n",
"['Jesús Alberto Dátolo' 'Jordi Amat Maas' 'David García De La Cruz']\n"
],
"name": "stdout"
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "EcI20iZJqd67",
"colab_type": "code",
"colab": {}
},
"source": [
"# to get \n",
"\n",
"home_player = pass_m[(pass_m.team_name == home_team)] \n",
"home_team_list = set()\n",
"home_team_list = home_player['player_name'].unique()\n",
"#print(substitution_belgium)\n",
"#belgium_list = [player for player in belgium_list if player not in substitution_belgium]\n",
"#belgium_list.remove([x for x in substitution_belgium])#belgium_list - substitution_belgium\n",
"home_player =pass_m['player_name'].isin(home_team_list)\n",
"pass_home = pass_m[home_player] #contains 11 players of home team\n",
"\n",
"away_player = pass_m[(pass_m.team_name == away_team)] \n",
"away_list = away_player['player_name'].unique()\n",
"#away_list = away_list - substitution_brazil\n",
"away_player = pass_m['player_name'].isin(away_list)\n",
"pass_away = pass_m[away_player]"
],
"execution_count": 0,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "lzKdQhmSqfnn",
"colab_type": "code",
"outputId": "e1700207-3fd6-4234-e6ec-2c4f4d6efcb0",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 457
}
},
"source": [
"pass_home.head()"
],
"execution_count": 89,
"outputs": [
{
"output_type": "execute_result",
"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>50_50_outcome_id</th>\n",
" <th>50_50_outcome_name</th>\n",
" <th>bad_behaviour_card_id</th>\n",
" <th>bad_behaviour_card_name</th>\n",
" <th>ball_receipt_outcome_id</th>\n",
" <th>ball_receipt_outcome_name</th>\n",
" <th>ball_recovery_recovery_failure</th>\n",
" <th>block_deflection</th>\n",
" <th>block_offensive</th>\n",
" <th>carry_end_location</th>\n",
" <th>clearance_aerial_won</th>\n",
" <th>clearance_body_part_id</th>\n",
" <th>clearance_body_part_name</th>\n",
" <th>clearance_head</th>\n",
" <th>clearance_left_foot</th>\n",
" <th>clearance_right_foot</th>\n",
" <th>counterpress</th>\n",
" <th>dribble_nutmeg</th>\n",
" <th>dribble_outcome_id</th>\n",
" <th>dribble_outcome_name</th>\n",
" <th>dribble_overrun</th>\n",
" <th>duel_outcome_id</th>\n",
" <th>duel_outcome_name</th>\n",
" <th>duel_type_id</th>\n",
" <th>duel_type_name</th>\n",
" <th>duration</th>\n",
" <th>foul_committed_advantage</th>\n",
" <th>foul_committed_card_id</th>\n",
" <th>foul_committed_card_name</th>\n",
" <th>foul_committed_offensive</th>\n",
" <th>foul_committed_type_id</th>\n",
" <th>foul_committed_type_name</th>\n",
" <th>foul_won_advantage</th>\n",
" <th>foul_won_defensive</th>\n",
" <th>goalkeeper_body_part_id</th>\n",
" <th>goalkeeper_body_part_name</th>\n",
" <th>goalkeeper_end_location</th>\n",
" <th>goalkeeper_outcome_id</th>\n",
" <th>goalkeeper_outcome_name</th>\n",
" <th>goalkeeper_position_id</th>\n",
" <th>...</th>\n",
" <th>period</th>\n",
" <th>play_pattern_id</th>\n",
" <th>play_pattern_name</th>\n",
" <th>player_id</th>\n",
" <th>player_name</th>\n",
" <th>position_id</th>\n",
" <th>position_name</th>\n",
" <th>possession</th>\n",
" <th>possession_team_id</th>\n",
" <th>possession_team_name</th>\n",
" <th>related_events</th>\n",
" <th>second</th>\n",
" <th>shot_aerial_won</th>\n",
" <th>shot_body_part_id</th>\n",
" <th>shot_body_part_name</th>\n",
" <th>shot_end_location</th>\n",
" <th>shot_first_time</th>\n",
" <th>shot_freeze_frame</th>\n",
" <th>shot_key_pass_id</th>\n",
" <th>shot_one_on_one</th>\n",
" <th>shot_outcome_id</th>\n",
" <th>shot_outcome_name</th>\n",
" <th>shot_redirect</th>\n",
" <th>shot_statsbomb_xg</th>\n",
" <th>shot_technique_id</th>\n",
" <th>shot_technique_name</th>\n",
" <th>shot_type_id</th>\n",
" <th>shot_type_name</th>\n",
" <th>substitution_outcome_id</th>\n",
" <th>substitution_outcome_name</th>\n",
" <th>substitution_replacement_id</th>\n",
" <th>substitution_replacement_name</th>\n",
" <th>tactics_formation</th>\n",
" <th>tactics_lineup</th>\n",
" <th>team_id</th>\n",
" <th>team_name</th>\n",
" <th>timestamp</th>\n",
" <th>type_id</th>\n",
" <th>type_name</th>\n",
" <th>under_pressure</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\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>NaN</td>\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>NaN</td>\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>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>0.606100</td>\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>NaN</td>\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>NaN</td>\n",
" <td>...</td>\n",
" <td>1</td>\n",
" <td>9</td>\n",
" <td>From Kick Off</td>\n",
" <td>26609.0</td>\n",
" <td>Pablo Daniel Osvaldo</td>\n",
" <td>23.0</td>\n",
" <td>Center Forward</td>\n",
" <td>2</td>\n",
" <td>214</td>\n",
" <td>Espanyol</td>\n",
" <td>[ca57ebcb-f65d-4d0c-b54d-c2ea0ccb8553]</td>\n",
" <td>0</td>\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>NaN</td>\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>NaN</td>\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>NaN</td>\n",
" <td>NaN</td>\n",
" <td>214</td>\n",
" <td>Espanyol</td>\n",
" <td>00:00:00.738</td>\n",
" <td>30</td>\n",
" <td>Pass</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>8</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>NaN</td>\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>NaN</td>\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>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>1.776163</td>\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>NaN</td>\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>NaN</td>\n",
" <td>...</td>\n",
" <td>1</td>\n",
" <td>9</td>\n",
" <td>From Kick Off</td>\n",
" <td>26211.0</td>\n",
" <td>Joan Verdú Fernández</td>\n",
" <td>21.0</td>\n",
" <td>Left Wing</td>\n",
" <td>2</td>\n",
" <td>214</td>\n",
" <td>Espanyol</td>\n",
" <td>[cb6b2c06-a935-4588-b7cb-e1e952c9ddbe]</td>\n",
" <td>2</td>\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>NaN</td>\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>NaN</td>\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>NaN</td>\n",
" <td>NaN</td>\n",
" <td>214</td>\n",
" <td>Espanyol</td>\n",
" <td>00:00:02.511</td>\n",
" <td>30</td>\n",
" <td>Pass</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16</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>NaN</td>\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>NaN</td>\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>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>1.242900</td>\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>NaN</td>\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>NaN</td>\n",
" <td>...</td>\n",
" <td>1</td>\n",
" <td>9</td>\n",
" <td>From Kick Off</td>\n",
" <td>7029.0</td>\n",
" <td>José María Callejón Bueno</td>\n",
" <td>17.0</td>\n",
" <td>Right Wing</td>\n",
" <td>2</td>\n",
" <td>214</td>\n",
" <td>Espanyol</td>\n",
" <td>[34e65d1a-4eca-4b55-8340-d125a8a32808, a6aedc7...</td>\n",
" <td>9</td>\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>NaN</td>\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>NaN</td>\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>NaN</td>\n",
" <td>NaN</td>\n",
" <td>214</td>\n",
" <td>Espanyol</td>\n",
" <td>00:00:09.581</td>\n",
" <td>30</td>\n",
" <td>Pass</td>\n",
" <td>True</td>\n",
" </tr>\n",
" <tr>\n",
" <th>20</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>NaN</td>\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>NaN</td>\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>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>1.298500</td>\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>NaN</td>\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>NaN</td>\n",
" <td>...</td>\n",
" <td>1</td>\n",
" <td>4</td>\n",
" <td>From Throw In</td>\n",
" <td>6886.0</td>\n",
" <td>Dídac Vilá Rosselló</td>\n",
" <td>6.0</td>\n",
" <td>Left Back</td>\n",
" <td>3</td>\n",
" <td>214</td>\n",
" <td>Espanyol</td>\n",
" <td>[98eb8c82-78c5-4c62-8c1b-02f5194eec55]</td>\n",
" <td>18</td>\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>NaN</td>\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>NaN</td>\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>NaN</td>\n",
" <td>NaN</td>\n",
" <td>214</td>\n",
" <td>Espanyol</td>\n",
" <td>00:00:18.784</td>\n",
" <td>30</td>\n",
" <td>Pass</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>24</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>NaN</td>\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>NaN</td>\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>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>0.950262</td>\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>NaN</td>\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>NaN</td>\n",
" <td>...</td>\n",
" <td>1</td>\n",
" <td>4</td>\n",
" <td>From Throw In</td>\n",
" <td>24783.0</td>\n",
" <td>Javier Márquez Moreno</td>\n",
" <td>13.0</td>\n",
" <td>Right Center Midfield</td>\n",
" <td>3</td>\n",
" <td>214</td>\n",
" <td>Espanyol</td>\n",
" <td>[1323492f-0fdc-4df7-bfd2-1a3f8c7b63e5, e27e148...</td>\n",
" <td>20</td>\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>NaN</td>\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>NaN</td>\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>NaN</td>\n",
" <td>NaN</td>\n",
" <td>214</td>\n",
" <td>Espanyol</td>\n",
" <td>00:00:20.122</td>\n",
" <td>30</td>\n",
" <td>Pass</td>\n",
" <td>True</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>5 rows × 122 columns</p>\n",
"</div>"
],
"text/plain": [
" 50_50_outcome_id 50_50_outcome_name ... type_name under_pressure\n",
"4 NaN NaN ... Pass NaN\n",
"8 NaN NaN ... Pass NaN\n",
"16 NaN NaN ... Pass True\n",
"20 NaN NaN ... Pass NaN\n",
"24 NaN NaN ... Pass True\n",
"\n",
"[5 rows x 122 columns]"
]
},
"metadata": {
"tags": []
},
"execution_count": 89
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "b81BeCpOqhel",
"colab_type": "code",
"colab": {}
},
"source": [
"def draw_pitch(ax):\n",
" # focus on only half of the pitch\n",
" #Pitch Outline & Centre Line\n",
" Pitch = Rectangle([0,0], width = 120, height = 80, fill = False)\n",
" #Left, Right Penalty Area and midline\n",
" LeftPenalty = Rectangle([0,22.3], width = 14.6, height = 35.3, fill = False)\n",
" RightPenalty = Rectangle([105.4,22.3], width = 14.6, height = 35.3, fill = False)\n",
" midline = ConnectionPatch([60,0], [60,80], \"data\", \"data\")\n",
"\n",
" #Left, Right 6-yard Box\n",
" LeftSixYard = Rectangle([0,32], width = 4.9, height = 16, fill = False)\n",
" RightSixYard = Rectangle([115.1,32], width = 4.9, height = 16, fill = False)\n",
"\n",
"\n",
" #Prepare Circles\n",
" centreCircle = plt.Circle((60,40),8.1,color=\"white\", fill = False)\n",
" centreSpot = plt.Circle((60,40),0.71,color=\"white\")\n",
" #Penalty spots and Arcs around penalty boxes\n",
" leftPenSpot = plt.Circle((9.7,40),0.71,color=\"white\")\n",
" rightPenSpot = plt.Circle((110.3,40),0.71,color=\"white\")\n",
" leftArc = Arc((9.7,40),height=16.2,width=16.2,angle=0,theta1=310,theta2=50,color=\"white\")\n",
" rightArc = Arc((110.3,40),height=16.2,width=16.2,angle=0,theta1=130,theta2=230,color=\"white\")\n",
" \n",
" element = [Pitch, LeftPenalty, RightPenalty, midline, LeftSixYard, RightSixYard, centreCircle, \n",
" centreSpot, rightPenSpot, leftPenSpot, leftArc, rightArc]\n",
" for i in element:\n",
" ax.add_patch(i)"
],
"execution_count": 0,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "dlpn4HOe6UUg",
"colab_type": "code",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 1000
},
"outputId": "487a0839-e0f5-4266-aeae-845b55eddf72"
},
"source": [
"filenames_home = []\n",
"players = home_team_list #['Alisson Ramsés Becker','Fágner Conserva Lemos','Fernando Luiz Rosa','Gabriel Fernando de Jesus','João Miranda de Souza Filho','José Paulo Bezzera Maciel Júnior','Marcelo Vieira da Silva Júnior','Neymar da Silva Santos Junior','Philippe Coutinho Correia','Thiago Emiliano da Silva','Willian Borges da Silva']\n",
"fig=plt.figure() #set up the figures\n",
"from matplotlib import rcParams\n",
"plt.style.use('dark_background')\n",
"fig.set_size_inches(16,9)\n",
"ax=fig.add_subplot(1,1,1)\n",
"draw_pitch(ax) #overlay our different objects on the pitch\n",
"plt.ylim(-2, 82)\n",
"plt.xlim(-2, 122)\n",
"plt.axis('off')\n",
"y_loc =0\n",
"timestamp = ['00:10:00:000','00:15:00:000','00:20:00:000','00:25:00:000','00:30:00:000','00:35:00:000','00:40:00:000','00:45:00:000','00:50:00:000']\n",
"time = 0\n",
"half =1\n",
"while (time < len(timestamp) ):\n",
" for player in players:\n",
" x_avg = 0\n",
" y_avg = 0\n",
" touches = 0\n",
" if player in players:\n",
" #print(players[player])\n",
" if time != 0:\n",
" #print('YES.',timestamp[time])\n",
" play_temp = pass_home[ (pass_home.timestamp > timestamp[time-1]) & (pass_home.timestamp <= timestamp[time])]\n",
" else:\n",
" play_temp = pass_home[(pass_home.timestamp <= timestamp[time])] \n",
" \n",
" play_temp = play_temp[(play_temp.player_name == player) & (play_temp.period == half)]\n",
" \n",
" if len(play_temp) != 0:\n",
" for i in range(len(play_temp)):\n",
" touches+=1\n",
" #https://math.stackexchange.com/questions/1013230/how-to-find-coordinates-of-reflected-point\n",
" #y_loc = (play_temp.iloc[i]['location'][1] + 40 ) %80\n",
" y_loc = -2*(play_temp.iloc[i]['location'][1] - 40) + play_temp.iloc[i]['location'][1] \n",
" x_avg = x_avg + play_temp.iloc[i]['location'][0]\n",
" y_avg = y_avg + y_loc\n",
" if len(play_temp) != 0: \n",
" x_avg = x_avg/len(play_temp)\n",
" y_avg = y_avg/len(play_temp)\n",
" \n",
" ax.scatter(x_avg, y_avg, s= (5 *touches )) \n",
" ax.annotate(player, (x_avg, y_avg))\n",
" plt.text(50,-4,str(half)+' Half '+str(timestamp[time]),fontsize=20,color='#cb4154') \n",
" plt.savefig('home_image'+ str(half) + str(timestamp[time]) + str('.png'))\n",
" filenames_home.append('home_image'+ str(half) + str(timestamp[time]) + str('.png'))\n",
" plt.cla()\n",
" time +=1\n",
" if time == 8 and half ==1:\n",
" time = 0\n",
" half = 2\n",
" #fig=plt.figure()\n",
" plt.style.use('dark_background')\n",
" fig.set_size_inches(16,9)\n",
" ax=fig.add_subplot(1,1,1)\n",
" draw_pitch(ax) #overlay our different objects on the pitch\n",
" plt.ylim(-2, 82)\n",
" plt.xlim(-2, 122)\n",
" plt.axis('off')\n",
" kargs = { 'duration': 2 }\n",
"\n",
"import imageio\n",
"images = []\n",
"for filename in filenames_home:\n",
" frame = 2*(i**0.5) \n",
" images.append(imageio.imread(filename))\n",
"imageio.mimsave('home.gif', images,**kargs)\n",
"#plt.show()"
],
"execution_count": 189,
"outputs": [
{
"output_type": "stream",
"text": [
"/usr/local/lib/python3.6/dist-packages/matplotlib/figure.py:98: MatplotlibDeprecationWarning: \n",
"Adding an axes using the same arguments as a previous axes currently reuses the earlier instance. In a future version, a new instance will always be created and returned. Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.\n",
" \"Adding an axes using the same arguments as a previous axes \"\n",
"/usr/local/lib/python3.6/dist-packages/matplotlib/figure.py:98: MatplotlibDeprecationWarning: \n",
"Adding an axes using the same arguments as a previous axes currently reuses the earlier instance. In a future version, a new instance will always be created and returned. Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.\n",
" \"Adding an axes using the same arguments as a previous axes \"\n",
"/usr/local/lib/python3.6/dist-packages/matplotlib/figure.py:98: MatplotlibDeprecationWarning: \n",
"Adding an axes using the same arguments as a previous axes currently reuses the earlier instance. In a future version, a new instance will always be created and returned. Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.\n",
" \"Adding an axes using the same arguments as a previous axes \"\n",
"/usr/local/lib/python3.6/dist-packages/matplotlib/figure.py:98: MatplotlibDeprecationWarning: \n",
"Adding an axes using the same arguments as a previous axes currently reuses the earlier instance. In a future version, a new instance will always be created and returned. Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.\n",
" \"Adding an axes using the same arguments as a previous axes \"\n",
"/usr/local/lib/python3.6/dist-packages/matplotlib/figure.py:98: MatplotlibDeprecationWarning: \n",
"Adding an axes using the same arguments as a previous axes currently reuses the earlier instance. In a future version, a new instance will always be created and returned. Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.\n",
" \"Adding an axes using the same arguments as a previous axes \"\n",
"/usr/local/lib/python3.6/dist-packages/matplotlib/figure.py:98: MatplotlibDeprecationWarning: \n",
"Adding an axes using the same arguments as a previous axes currently reuses the earlier instance. In a future version, a new instance will always be created and returned. Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.\n",
" \"Adding an axes using the same arguments as a previous axes \"\n",
"/usr/local/lib/python3.6/dist-packages/matplotlib/figure.py:98: MatplotlibDeprecationWarning: \n",
"Adding an axes using the same arguments as a previous axes currently reuses the earlier instance. In a future version, a new instance will always be created and returned. Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.\n",
" \"Adding an axes using the same arguments as a previous axes \"\n",
"/usr/local/lib/python3.6/dist-packages/matplotlib/figure.py:98: MatplotlibDeprecationWarning: \n",
"Adding an axes using the same arguments as a previous axes currently reuses the earlier instance. In a future version, a new instance will always be created and returned. Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.\n",
" \"Adding an axes using the same arguments as a previous axes \"\n",
"/usr/local/lib/python3.6/dist-packages/matplotlib/figure.py:98: MatplotlibDeprecationWarning: \n",
"Adding an axes using the same arguments as a previous axes currently reuses the earlier instance. In a future version, a new instance will always be created and returned. Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.\n",
" \"Adding an axes using the same arguments as a previous axes \"\n",
"/usr/local/lib/python3.6/dist-packages/matplotlib/figure.py:98: MatplotlibDeprecationWarning: \n",
"Adding an axes using the same arguments as a previous axes currently reuses the earlier instance. In a future version, a new instance will always be created and returned. Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.\n",
" \"Adding an axes using the same arguments as a previous axes \"\n",
"/usr/local/lib/python3.6/dist-packages/matplotlib/figure.py:98: MatplotlibDeprecationWarning: \n",
"Adding an axes using the same arguments as a previous axes currently reuses the earlier instance. In a future version, a new instance will always be created and returned. Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.\n",
" \"Adding an axes using the same arguments as a previous axes \"\n",
"/usr/local/lib/python3.6/dist-packages/matplotlib/figure.py:98: MatplotlibDeprecationWarning: \n",
"Adding an axes using the same arguments as a previous axes currently reuses the earlier instance. In a future version, a new instance will always be created and returned. Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.\n",
" \"Adding an axes using the same arguments as a previous axes \"\n",
"/usr/local/lib/python3.6/dist-packages/matplotlib/figure.py:98: MatplotlibDeprecationWarning: \n",
"Adding an axes using the same arguments as a previous axes currently reuses the earlier instance. In a future version, a new instance will always be created and returned. Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.\n",
" \"Adding an axes using the same arguments as a previous axes \"\n",
"/usr/local/lib/python3.6/dist-packages/matplotlib/figure.py:98: MatplotlibDeprecationWarning: \n",
"Adding an axes using the same arguments as a previous axes currently reuses the earlier instance. In a future version, a new instance will always be created and returned. Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.\n",
" \"Adding an axes using the same arguments as a previous axes \"\n",
"/usr/local/lib/python3.6/dist-packages/matplotlib/figure.py:98: MatplotlibDeprecationWarning: \n",
"Adding an axes using the same arguments as a previous axes currently reuses the earlier instance. In a future version, a new instance will always be created and returned. Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.\n",
" \"Adding an axes using the same arguments as a previous axes \"\n",
"/usr/local/lib/python3.6/dist-packages/matplotlib/figure.py:98: MatplotlibDeprecationWarning: \n",
"Adding an axes using the same arguments as a previous axes currently reuses the earlier instance. In a future version, a new instance will always be created and returned. Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.\n",
" \"Adding an axes using the same arguments as a previous axes \"\n",
"/usr/local/lib/python3.6/dist-packages/matplotlib/figure.py:98: MatplotlibDeprecationWarning: \n",
"Adding an axes using the same arguments as a previous axes currently reuses the earlier instance. In a future version, a new instance will always be created and returned. Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.\n",
" \"Adding an axes using the same arguments as a previous axes \"\n"
],
"name": "stderr"
},
{
"output_type": "display_data",
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA54AAAIICAYAAAAGxzENAAAABHNCSVQIC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NauXRsrVqyIxYsXx+LFi2PRokWxaNGiWLx4cXz66ae5PxQASE54\nAsAXaNSoUXTq1Ck6deoUnTt3Xv/PHTp0iBUrVvyfiFy0aFEsWbIkPvvss6isrIyKiopo1qxZVFZW\nRuvWrWPfffddH6l/+/PDDz+M119/PWbNmhWzZs2K119/PWbOnBmLFi3K/aEDQI2piIgi94gvUxSl\nNXHevHnRrl273DNKSlEUUVFRkXsGwL+sSZMmsffee0f37t2je/fusddee8U777yzPg7/9uebb74Z\nK1eu/Nz307t37xg6dGj07dv3C/99O+644/qY/VvcfuMb34hFixbFpEmT1p933323pj9UgCzcbtyw\nuXPnRtu2bXPPWK+mP0d1JjxL6T/OUttTClwToC7bfvvto3///nHUUUfFv/3bv8XMmTPXB9+UKVPi\n448//srvc2PDc0MqKiqiS5cu6+P3wAMPjGXLlsVjjz0W9913X0yZMiXWrVv3ld8vQClwu3HDSum6\npNjiobYA1Evbbbdd9O/fP44++uj4+te/Ho8++mhcd911MXHixFi+fHnWbUVRxPTp02P69Onxi1/8\nIiIivv71r8dhhx0WN9xwQ2yzzTZx//33x9ixY+PZZ58tuUcGAcDf86y2ANQrBx10UPzxj3+MmTNn\nxp577hkjRoyI7bbbLk444YT4j//4j+zR+XlmzpwZ11xzTey+++7RvXv3mD9/ftx8880xZ86cGDp0\naGy++ea5JwLA5xKeAJS9pk2bximnnBIzZsyIG264IR599NHYYYcd4vjjj49x48bF6tWrc0/8St56\n6624+uqrY7fddosBAwZE165dY86cOXHrrbdG586dc88DgH8gPAEoW82aNYsf//jHUV1dHQcffHCc\neeaZ0aVLl7j99tu/8ImB6pIXX3wxBg8eHJ06dYr58+fHU089FePGjYvddtst9zQAWE94AlB2GjZs\nGN///vfjzTffjN122y3222+/OOKII+Lpp5/OPS2ZBQsWxPDhw6NNmzYxbty4ePzxx+O3v/1ttGnT\nJvc0ABCeAJSXI444ImbMmBEDBw6MI444IgYOHBhvvfVW7lm1ZvXq1XHLLbdEhw4d4u23346//OUv\nMWrUqNhyyy1zTwOgHhOeAJSFbbfdNh566KG46qqr4uyzz46ePXvGiy++mHtWNsuXL4/hw4dH586d\no0mTJvHaa6/FkUcemXsWAPWU8KRGbbfddtG8efPcM4B65thjj41XXnklZsyYEbvvvnuMHz8+96SS\nsXDhwjjttNNiwIAB8dOf/jTuvffe2HrrrXPPAuqZnXfeOfcEMhOe1KhBgwbFyy+/HHvttVfuKUA9\nsO2228Yf//jHuOCCC+Lggw+OSy+9tM49Q21tee6552K33XaLd999N6ZPnx79+/fPPQmoB5o2bRq3\n3HJL/OlPf4qmTZvmnkNmRamf4n9eGbtkTqntKYXzv6/JUUcdVcyfP78YOnRo9l2O45TvOeCAA4p3\n3323uPzyy4tGjRpl3/P3p3fv3sX48eOz79jQ2XvvvYu33nqruOGGG0ry2jmOUx5nl112KWbNmlX8\n5je/KVq0aLH+f3dbesOnlK5Loi35P7C69EkoxT2lcP7+mrRu3bp46aWXijvuuMONGsdxavycccYZ\nxfz584u+fftm3/J5p5TDMyKKli1bFo888kjxzDPPFF/72tey73Ecp7zOQQcdVMyfP7848cQT/+Hv\n3Jbe8Cml65Jii4faksS7774bBxxwQGy11VYxYcIEz6YI1IjKysq49dZb49RTT41vfetbfpfzX7B0\n6dI4/PDD489//nNMmzYtunTpknsSUCZOPvnk+N3vfhfHHHNM3HnnnbnnUCKEJ8l88skncdRRR8Xz\nzz8fU6dOjV122SX3JKAOa9y4cTz88MOx4447xr777htz587NPanOK4oihg0bFj/+8Y/jySefjP33\n3z/3JKAOa9CgQYwcOTKGDh0a+++/f0yaNCn3JEpIZe4BlLd169bFj370o/jrX/8akyZNip49e8br\nr7+eexZQxzRp0iQeeuihWLp0aXzve9+LNWvW5J5UVn7/+9/HokWL4oEHHogBAwbE5MmTc08C6piK\niooYPXp07LjjjvGtb30rPvroo9yTKDHu8aRW3HnnnXHuuefG+PHjo3379rnnAHVI06ZN45FHHon/\n/u//jmOPPVZ0JvLUU0/FwIED4/77748ePXrkngPUMTfffHNUVVXFwQc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2Uk1mzZm3U\nD8jWrVsXL7zwQi0sqn+EZx0wfvz4ePPNN+PTTz/93LdZs2ZNLF++PO64445aXJZe48aNhSeUmVWr\nVkXTpk1zz6hRc+bMifvvvz9WrFjxhW+3Zs2aGD58eC2tqh2NGjWKoig2+p4EoPStXr06GjdunHtG\njVqxYkVcfvnlX/rSVitXroxzzjmnllbVL8KzjujTp0+8+uqrsWzZsn/45v7xxx/HvHnzYr/99iu7\nSGvdunW8//77uWcANei9996L1q1b555R404++eQYN25cLF++PNasWfN//m7ZsmWxePHi6NWrV3zw\nwQeZFqbRunXreO+993LPAGrQBx98EDvssEPuGTXuuuuuixtvvDFWrFjxD3fofPLJJ7F8+fIYPHhw\nTJs2LdPC8uZ1POuIDz/8MPbZZ5/o2bNnHHfccbH33ntHgwYNYsaMGTF69Oj405/+VJYPc2rfvn3M\nnj079wygBlVXV0evXr1yz6hxq1evjqOPPjr23HPP+N73vheHH354tGrVKp577rkYM2ZMPPzww2X5\nLJFt2rSJ6urq3DOAGjR79uxo37597hlJXHTRRTF69OgYNGhQHHHEEbHpppvGggUL4p577on77rsv\nFi1alHtiWcv+OjFfdkrpNW1KcU8pnFTX5LrrriuGDh2a/eNzHKfmzm677VZMnz49+47Up3fv3sX4\n8eOz70h9jj/++GLMmDHZdziOU3OnUaNGxapVq5K97rDb0qV/XbyOJ/VO+/btY86cOblnADWouro6\n2rRpk3sGNcQ9nlB+Pvvss5g/f35UVVXlnkIZEZ6UNA+1hfKzZMmSWLFihfgsE127do033ngj9wyg\nhs2ePTt23nnn3DMoI8KTkrXFFltEVVVVzJo1K/cUoIZNnjw5unfvnnsG/6KKioo48MADY9KkSbmn\nADXs+eefj3333Tf3DMqI8KRk9erVK5555pmye6ZeIGLSpEnCswx07tw5Pv74Y89qC2VowoQJ0bdv\n39wzKCPCk5LVp0+fGD9+fO4ZQAITJ04UnmWge/fuMXHixNwzgASeffbZ6Ny5c2yxxRa5p1AmhCcl\nq0+fPjFhwoTcM4AEXn/99dhss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pGeJLVr3/963jqqafi97//fe4p\nQAl477334oILLoh77703Nttss9xziIizzjortt9++7jmmmtyTwFKwPLly2PAgAFx/fXXxy677JJ7\nDnWI8CSbU089NTp27BjnnHNO7ilACRk9enQ888wzcffdd0eDBr5N5dS7d++48MIL48gjj4w1a9bk\nngOUiOnTp8fFF18c9913XzRp0iT3HOoI39HJYq+99oorrrgijj766Fi1alXuOUCJOfPMM6NFixZx\n5ZVX5p5Sb3Xo0CF++9vfxjHHHBPV1dW55wAl5rbbbosZM2bErbfemnsKdYTwpNZ16dIlHnnkkRgy\nZEi89dZbuecAJWjNmjXx3e9+N4455hi/R5RBy5Yt45FHHolLLrkknnnmmdxzgBJ1yimnRMeOHePa\na6/NPYU6QHhSqzp06BCPP/54nHXWWTFu3Ljcc4AS9uGHH8Zhhx0Wo0aNisMOOyz3nHqjRYsW8fjj\nj8djjz0Wt99+e+45QAn75JNP4t///d+jV69eMWzYsNxzKHGVuQdQf1RVVcUTTzwRl1xySYwdOzb3\nHKAOmDlzZhx88MHx2GOPRcOGDeOhhx7KPamstWzZMiZMmBBTp06N8847L/ccoA5YsmRJ9OnTJyZP\nnhzLli3zUit8LuFJraiqqoonn3wyRo0aFXfddVfuOUAd8tJLL0W/fv3iT3/6UzRs2DDuv//+3JPK\n0hZbbBETJkyIZ555xusqA1/JwoULo1evXjF58uRYvXp13HTTTbknUaKKUj9FUWTfUMp7SuF80TXZ\ne++9i/fee68466yzsu90HKfunq5duxbvv/9+cdxxx2XfsjGnd+/exfjx47Pv2Jiz7bbbFi+99FIx\ncuTI7Fscx6m7p127dsWsWbOKUaNGFQ0aNPjct3NbuvSvS6It+T+wuvRJKMU9pXA+75occ8wxxcKF\nC4tDDjkk+0bHcer+6dSpUzF79uziqquuKioqKrLv+aJTV8KzW7duRXV1dXHxxRdn3+I4Tt0/m2++\nefHEE08Ujz76aLHppptu8G3clt7wKaXrIjxL5JTanlI4G7oml112WTFv3ryiS5cu2fc5jlM+Z+ut\nty4mT55c/PGPfyxatmyZfc/nnboQngMHDiwWLlxY9O/fP/sWx3HK51RWVha//OUvi1dffbWoqqr6\nh793W3rDp5SuS4otntWWGrfGJP24AAAKjElEQVTlllvG/fffH4ccckjss88+8dprr+WeBJSRxYsX\nR8+ePeOdd96JF154Ibp06ZJ7Up2zySabxPXXXx9XXnll9O7dOx544IHck4AysmbNmvjBD34Qo0eP\njqlTp0a/fv1yT6JEZC/qLzulVP+luKcUzt+uybe//e3inXfeKUaNGlU0btw4+y7Hccr7HHvsscXC\nhQuLiy++uKisrMy+53+fUr3Hc4899ihee+214qGHHio233zz7Hscxynv06NHj6K6urq48cYbi002\n2aSIcFv6804pXRf3eFLymjVrFieeeGKce+658emnn+aeA5S5e+65J/bYY4/Yf//9Y9q0ae79/AKN\nGzeOq6++OsaNGxdXX311HHnkkbFkyZLcs4AyN3HixNhtt91i4cKFsWbNmtxzyCx7UX/ZKaX6L8U9\npXBcE8dxcp8TTjihWLhwYTFs2LCiSZMm2feU0j2e++67bzFz5szi/vvvL7bZZpvsexzHqd/H7cbS\nvy7u8QSAzzF69Ojo1q1bfOMb34g333wzhgwZEg0a1O9vc7vuums8+OCDce+998ZPfvKT+O53vxsL\nFizIPQuAeqh+f0cGoKy8//77MWDAgBgwYECccMIJMX369Dj00ENzz6p122+/ffzqV7+KyZMnx7PP\nPhu77rpr3HfffblnAVCPCU8Ays60adOie/fuccEFF8RVV10Vzz33XAwYMCAqKytzT0uqQ4cOceON\nN8b06dPjo48+il133TWuu+66WLVqVe5pANRzwhOAsvXYY49Ft27d4tprr40zzjgj5syZExdeeGFs\ntdVWuafVmIqKiujbt2+MGzcupkyZEkuXLo2uXbvGhRde6MmDACgZ5f2jXwDqvXXr1sWDDz4YDz74\nYHTr1i3OOuuseOutt+Lhhx+Oe++9N55++uk6+UyLbdu2jQEDBsSJJ54Yq1atihtuuCH69+/v3k0A\nSpJ7PAGoN1555ZU48cQTY9ddd43XXnstLr/88nj//ffj17/+dfTq1SsaNmyYe+IXqqqqivPOOy+m\nTZsW06ZNi5122ilOOeWU2H333WP06NGiE4CSVRH/8/S2Ja0oiqioqMg9Y71S21MKXBOgrqqqqorv\nfve7cfTRR8dOO+0UkyZNWn9mzJgR//OM8l9d7969Y+jQodG3b99/ettWW20VBxxwQHTv3j26d+8e\nrVu3jgcffDDuu+++mDhxYqxdu/afft8AubjduGGldF1SbBGe/4RS21MKXBOgHOywww7Ro0eP9aG3\n1VZbxZQpU2LatGkxa9aseP3112P27NkbFXxfNTy33nrr6NSpU3Tu3Dm6du0aBxxwQFRVVcVzzz23\nPoRffPHFOvmwYID/ze3GDSul6yI8S0Sp7SkFrglQjrbbbrs48MAD45vf/Ob6KNx+++1j9uzZ8cYb\nb8QHH3wQixYtisWLF6//86OPPoo1a9bE3nvvHUOGDIlTTjklKisro1mzZrH11ltHq1at1v/ZqlWr\naN++fXTq1CkqKyvXx+3MmTNjypQp8fLLL7tXEyg7bjduWCldl3odnqVk3rx50a5du9wzSkop/R8F\nIKUmTZrELrvsEh07doxtttnmH0Jy8803j8rKymjRokVsueWWUV1dHWvXro2VK1f+n0j92z/PnTs3\nXn/99ViwYEHuDw2gVrjduGFz586Ntm3b5p6xXr0NT/9xljafI4D/qyZ+xxOgHLndWPpSfI48qy0A\nAABJCU8AAACSEp4AAAAkJTwBAABISngCAACQlPAEAAAgKeEJAABAUsITAACApIQnAAAASQlPAAAA\nkhKeAAAAJCU8AQAASEp4AgAAkJTwBAAAICnhCQAAQFLCEwAAgKSEJwAAAEkJTwAAAJISngAAACQl\nPAEAAEhKeAIAAJCU8AQAACAp4QkAAEBSwhMAAICkhCcAAABJCU8AAACSEp4AAAAkJTwBAABISngC\nAACQlPAEAAAgKeEJAABAUsITAACApIQnAAAASQlPAAAAkhKeAAAAJCU8AQAASEp4AgAAkJTwBAAA\nICnhCQAAQFLCEwAAgKSEJwAAAEkJTwAAAJISngAAACQlPAEAAEhKeAIAAJCU8AQAACAp4QkAAEBS\nwhMAAICkhCcAAABJCU8AAACSEp4AAA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AAACSEp4AAAAk\nJTwBAABISngCAACQlPAEAAAgKeEJAABAUpW5B2yMefPmRVEUuWcAwFfm+xcAdc28efNq/H1WRITv\niAAAACTjobYAAAAkJTwBAABISngCAACQlPAEAAAgKeEJAABAUsITAACApIQnAAAASQlPAAAAkhKe\nAAAAJCU8AQAASEp4AgAAkJTwBAAAICnhCQAAQFLCEwAAgKSEJwAAAEkJTwAAAJISngAAACQlPAEA\nAEhKeAIAAJCU8AQAACAp4QkAAEBSwhMAAICkhCcAAABJCU8AAACSEp4AAAAkJTwBAABISngCAACQ\nlPAEAAAgKeEJAABAUsITAACApIQnAAAASQlPAAAAkhKeAAAAJCU8AQAASOr/ATwv/+TOheH3AAAA\nAElFTkSuQmCC\n",
"text/plain": [
"<Figure size 1152x648 with 1 Axes>"
]
},
"metadata": {
"tags": []
}
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "vi-Sar_IZ9Ri",
"colab_type": "code",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 1000
},
"outputId": "0477ad03-0d55-451f-e0c9-be2098e1ad59"
},
"source": [
"filenames_away = []\n",
"players = away_list #['Alisson Ramsés Becker','Fágner Conserva Lemos','Fernando Luiz Rosa','Gabriel Fernando de Jesus','João Miranda de Souza Filho','José Paulo Bezzera Maciel Júnior','Marcelo Vieira da Silva Júnior','Neymar da Silva Santos Junior','Philippe Coutinho Correia','Thiago Emiliano da Silva','Willian Borges da Silva']\n",
"fig=plt.figure() #set up the figures\n",
"from matplotlib import rcParams\n",
"plt.style.use('dark_background')\n",
"fig.set_size_inches(16,9)\n",
"ax=fig.add_subplot(1,1,1)\n",
"draw_pitch(ax) #overlay our different objects on the pitch\n",
"plt.ylim(-2, 82)\n",
"plt.xlim(-2, 122)\n",
"plt.axis('off')\n",
"y_loc =0\n",
"timestamp = ['00:10:00:000','00:15:00:000','00:20:00:000','00:25:00:000','00:30:00:000','00:35:00:000','00:40:00:000','00:45:00:000','00:50:00:000']\n",
"time = 0\n",
"half =1\n",
"while (time < len(timestamp) ):\n",
" for player in players:\n",
" x_avg = 0\n",
" y_avg = 0\n",
" touches = 0\n",
" if player in players:\n",
" #print(players[player])\n",
" if time != 0:\n",
" #print('YES.',timestamp[time])\n",
" play_temp = pass_away[ (pass_away.timestamp > timestamp[time-1]) & (pass_away.timestamp <= timestamp[time])]\n",
" else:\n",
" play_temp = pass_away[(pass_away.timestamp <= timestamp[time])] \n",
" \n",
" play_temp = play_temp[(play_temp.player_name == player) & (play_temp.period == half)]\n",
" #print(play_temp.player_name ,play_temp.timestamp)\n",
" #print('\\n')\n",
" if len(play_temp) != 0:\n",
" for i in range(len(play_temp)):\n",
" touches+=1\n",
" #y_loc = (play_temp.iloc[i]['location'][1] + 40 ) %80\n",
" y_loc = -2*(play_temp.iloc[i]['location'][1] - 40) + play_temp.iloc[i]['location'][1] \n",
" x_avg = x_avg + play_temp.iloc[i]['location'][0]\n",
" y_avg = y_avg + y_loc\n",
" if len(play_temp) != 0: \n",
" x_avg = x_avg/len(play_temp)\n",
" y_avg = y_avg/len(play_temp)\n",
" #print(x_avg,y_avg,players[player])\n",
" ax.scatter(x_avg, y_avg, s= (5 *touches )) \n",
" ax.annotate(player, (x_avg, y_avg))\n",
" plt.text(50,-4,str(half)+' Half '+str(timestamp[time]),fontsize=20,color='#cb4154') \n",
" plt.savefig('away_image'+ str(half) + str(timestamp[time]) + str('.png'))\n",
" filenames_away.append('away_image'+ str(half) + str(timestamp[time]) + str('.png'))\n",
" plt.cla()\n",
" time +=1\n",
" if time == 8 and half ==1:\n",
" time = 0\n",
" half = 2\n",
" #fig=plt.figure()\n",
" plt.style.use('dark_background')\n",
" fig.set_size_inches(16,9)\n",
" ax=fig.add_subplot(1,1,1)\n",
" draw_pitch(ax) #overlay our different objects on the pitch\n",
" plt.ylim(-2, 82)\n",
" plt.xlim(-2, 122)\n",
" plt.axis('off')\n",
" \n",
"kargs = { 'duration': 2 }\n",
"import imageio\n",
"images = []\n",
"for filename in filenames_away:\n",
" frame = 2*(i**0.5) \n",
" images.append(imageio.imread(filename))\n",
"imageio.mimsave('away.gif', images,**kargs)"
],
"execution_count": 190,
"outputs": [
{
"output_type": "stream",
"text": [
"/usr/local/lib/python3.6/dist-packages/matplotlib/figure.py:98: MatplotlibDeprecationWarning: \n",
"Adding an axes using the same arguments as a previous axes currently reuses the earlier instance. In a future version, a new instance will always be created and returned. Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.\n",
" \"Adding an axes using the same arguments as a previous axes \"\n",
"/usr/local/lib/python3.6/dist-packages/matplotlib/figure.py:98: MatplotlibDeprecationWarning: \n",
"Adding an axes using the same arguments as a previous axes currently reuses the earlier instance. In a future version, a new instance will always be created and returned. Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.\n",
" \"Adding an axes using the same arguments as a previous axes \"\n",
"/usr/local/lib/python3.6/dist-packages/matplotlib/figure.py:98: MatplotlibDeprecationWarning: \n",
"Adding an axes using the same arguments as a previous axes currently reuses the earlier instance. In a future version, a new instance will always be created and returned. Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.\n",
" \"Adding an axes using the same arguments as a previous axes \"\n",
"/usr/local/lib/python3.6/dist-packages/matplotlib/figure.py:98: MatplotlibDeprecationWarning: \n",
"Adding an axes using the same arguments as a previous axes currently reuses the earlier instance. In a future version, a new instance will always be created and returned. Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.\n",
" \"Adding an axes using the same arguments as a previous axes \"\n",
"/usr/local/lib/python3.6/dist-packages/matplotlib/figure.py:98: MatplotlibDeprecationWarning: \n",
"Adding an axes using the same arguments as a previous axes currently reuses the earlier instance. In a future version, a new instance will always be created and returned. Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.\n",
" \"Adding an axes using the same arguments as a previous axes \"\n",
"/usr/local/lib/python3.6/dist-packages/matplotlib/figure.py:98: MatplotlibDeprecationWarning: \n",
"Adding an axes using the same arguments as a previous axes currently reuses the earlier instance. In a future version, a new instance will always be created and returned. Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.\n",
" \"Adding an axes using the same arguments as a previous axes \"\n",
"/usr/local/lib/python3.6/dist-packages/matplotlib/figure.py:98: MatplotlibDeprecationWarning: \n",
"Adding an axes using the same arguments as a previous axes currently reuses the earlier instance. In a future version, a new instance will always be created and returned. Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.\n",
" \"Adding an axes using the same arguments as a previous axes \"\n",
"/usr/local/lib/python3.6/dist-packages/matplotlib/figure.py:98: MatplotlibDeprecationWarning: \n",
"Adding an axes using the same arguments as a previous axes currently reuses the earlier instance. In a future version, a new instance will always be created and returned. Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.\n",
" \"Adding an axes using the same arguments as a previous axes \"\n",
"/usr/local/lib/python3.6/dist-packages/matplotlib/figure.py:98: MatplotlibDeprecationWarning: \n",
"Adding an axes using the same arguments as a previous axes currently reuses the earlier instance. In a future version, a new instance will always be created and returned. Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.\n",
" \"Adding an axes using the same arguments as a previous axes \"\n",
"/usr/local/lib/python3.6/dist-packages/matplotlib/figure.py:98: MatplotlibDeprecationWarning: \n",
"Adding an axes using the same arguments as a previous axes currently reuses the earlier instance. In a future version, a new instance will always be created and returned. Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.\n",
" \"Adding an axes using the same arguments as a previous axes \"\n",
"/usr/local/lib/python3.6/dist-packages/matplotlib/figure.py:98: MatplotlibDeprecationWarning: \n",
"Adding an axes using the same arguments as a previous axes currently reuses the earlier instance. In a future version, a new instance will always be created and returned. Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.\n",
" \"Adding an axes using the same arguments as a previous axes \"\n",
"/usr/local/lib/python3.6/dist-packages/matplotlib/figure.py:98: MatplotlibDeprecationWarning: \n",
"Adding an axes using the same arguments as a previous axes currently reuses the earlier instance. In a future version, a new instance will always be created and returned. Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.\n",
" \"Adding an axes using the same arguments as a previous axes \"\n",
"/usr/local/lib/python3.6/dist-packages/matplotlib/figure.py:98: MatplotlibDeprecationWarning: \n",
"Adding an axes using the same arguments as a previous axes currently reuses the earlier instance. In a future version, a new instance will always be created and returned. Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.\n",
" \"Adding an axes using the same arguments as a previous axes \"\n",
"/usr/local/lib/python3.6/dist-packages/matplotlib/figure.py:98: MatplotlibDeprecationWarning: \n",
"Adding an axes using the same arguments as a previous axes currently reuses the earlier instance. In a future version, a new instance will always be created and returned. Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.\n",
" \"Adding an axes using the same arguments as a previous axes \"\n",
"/usr/local/lib/python3.6/dist-packages/matplotlib/figure.py:98: MatplotlibDeprecationWarning: \n",
"Adding an axes using the same arguments as a previous axes currently reuses the earlier instance. In a future version, a new instance will always be created and returned. Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.\n",
" \"Adding an axes using the same arguments as a previous axes \"\n",
"/usr/local/lib/python3.6/dist-packages/matplotlib/figure.py:98: MatplotlibDeprecationWarning: \n",
"Adding an axes using the same arguments as a previous axes currently reuses the earlier instance. In a future version, a new instance will always be created and returned. Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.\n",
" \"Adding an axes using the same arguments as a previous axes \"\n",
"/usr/local/lib/python3.6/dist-packages/matplotlib/figure.py:98: MatplotlibDeprecationWarning: \n",
"Adding an axes using the same arguments as a previous axes currently reuses the earlier instance. In a future version, a new instance will always be created and returned. Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.\n",
" \"Adding an axes using the same arguments as a previous axes \"\n"
],
"name": "stderr"
},
{
"output_type": "display_data",
"data": {
"image/png": "iVBORw0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WrWLrrbeOVq1aRatWrWLz\nzTePysrK2HXXXWOnnXaKiy66KNauXRsrVqyIxYsXx+LFi2PRokWxaNGiWLx4cXz66ae5PxQASE54\nAsAXaNSoUXTq1Ck6deoUnTt3Xv/PHTp0iBUrVvyfiFy0aFEsWbIkPvvss6isrIyKiopo1qxZVFZW\nRuvWrWPfffddH6l/+/PDDz+M119/PWbNmhWzZs2K119/PWbOnBmLFi3K/aEDQI2piIgi94gvUxSl\nNXHevHnRrl273DNKSlEUUVFRkXsGwL+sSZMmsffee0f37t2je/fusddee8U777yzPg7/9uebb74Z\nK1eu/Nz307t37xg6dGj07dv3C/99O+644/qY/VvcfuMb34hFixbFpEmT1p933323pj9UgCzcbtyw\nuXPnRtu2bXPPWK+mP0d1JjxL6T/OUttTClwToC7bfvvto3///nHUUUfFv/3bv8XMmTPXB9+UKVPi\n448//srvc2PDc0MqKiqiS5cu6+P3wAMPjGXLlsVjjz0W9913X0yZMiXWrVv3ld8vQClwu3HDSum6\npNjiobYA1Evbbbdd9O/fP44++uj4+te/Ho8++mhcd911MXHixFi+fHnWbUVRxPTp02P69Onxi1/8\nIiIivv71r8dhhx0WN9xwQ2yzzTZx//33x9ixY+PZZ58tuUcGAcDf86y2ANQrBx10UPzxj3+MmTNn\nxp577hkjRoyI7bbbLk444YT4j//4j+zR+XlmzpwZ11xzTey+++7RvXv3mD9/ftx8880xZ86cGDp0\naGy++ea5JwLA5xKeAJS9pk2bximnnBIzZsyIG264IR599NHYYYcd4vjjj49x48bF6tWrc0/8St56\n6624+uqrY7fddosBAwZE165dY86cOXHrrbdG586dc88DgH8gPAEoW82aNYsf//jHUV1dHQcffHCc\neeaZ0aVLl7j99tu/8ImB6pIXX3wxBg8eHJ06dYr58+fHU089FePGjYvddtst9zQAWE94AlB2GjZs\nGN///vfjzTffjN122y3222+/OOKII+Lpp5/OPS2ZBQsWxPDhw6NNmzYxbty4ePzxx+O3v/1ttGnT\nJvc0ABCeAJSXI444ImbMmBEDBw6MI444IgYOHBhvvfVW7lm1ZvXq1XHLLbdEhw4d4u23346//OUv\nMWrUqNhyyy1zTwOgHhOeAJSFbbfdNh566KG46qqr4uyzz46ePXvGiy++mHtWNsuXL4/hw4dH586d\no0mTJvHaa6/FkUcemXsWAPWU8KRGbbfddtG8efPcM4B65thjj41XXnklZsyYEbvvvnuMHz8+96SS\nsXDhwjjttNNiwIAB8dOf/jTuvffe2HrrrXPPAuqZnXfeOfcEMhOe1KhBgwbFyy+/HHvttVfuKUA9\nsO2228Yf//jHuOCCC+Lggw+OSy+9tM49Q21tee6552K33XaLd999N6ZPnx79+/fPPQmoB5o2bRq3\n3HJL/OlPf4qmTZvmnkNmRamf4n9eGbtkTqntKYXzv6/JUUcdVcyfP78YOnRo9l2O45TvOeCAA4p3\n3323uPzyy4tGjRpl3/P3p3fv3sX48eOz79jQ2XvvvYu33nqruOGGG0ry2jmOUx5nl112KWbNmlX8\n5je/KVq0aLH+f3dbesOnlK5Loi35P7C69EkoxT2lcP7+mrRu3bp46aWXijvuuMONGsdxavycccYZ\nxfz584u+fftm3/J5p5TDMyKKli1bFo888kjxzDPPFF/72tey73Ecp7zOQQcdVMyfP7848cQT/+Hv\n3Jbe8Cml65Jii4faksS7774bBxxwQGy11VYxYcIEz6YI1IjKysq49dZb49RTT41vfetbfpfzX7B0\n6dI4/PDD489//nNMmzYtunTpknsSUCZOPvnk+N3vfhfHHHNM3HnnnbnnUCKEJ8l88skncdRRR8Xz\nzz8fU6dOjV122SX3JKAOa9y4cTz88MOx4447xr777htz587NPanOK4oihg0bFj/+8Y/jySefjP33\n3z/3JKAOa9CgQYwcOTKGDh0a+++/f0yaNCn3JEpIZe4BlLd169bFj370o/jrX/8akyZNip49e8br\nr7+eexZQxzRp0iQeeuihWLp0aXzve9+LNWvW5J5UVn7/+9/HokWL4oEHHogBAwbE5MmTc08C6piK\niooYPXp07LjjjvGtb30rPvroo9yTKDHu8aRW3HnnnXHuuefG+PHjo3379rnnAHVI06ZN45FHHon/\n/u//jm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Z2944999xzG/XIlFWrVsUTTzxRC4tqV6NGjcr22dWhPvrbk+2Uk1mzZm3U\nD8jWrVsXL7zwQi0sqn+EZx0wfvz4ePPNN+PTTz/93LdZs2ZNLF++PO64445aXJZe48aNhSeUmVWr\nVkXTpk1zz6hRc+bMifvvvz9WrFjxhW+3Zs2aGD58eC2tqh2NGjWKoig2+p4EoPStXr06GjdunHtG\njVqxYkVcfvnlX/rSVitXroxzzjmnllbVL8KzjujTp0+8+uqrsWzZsn/45v7xxx/HvHnzYr/99iu7\nSGvdunW8//77uWcANei9996L1q1b555R404++eQYN25cLF++PNasWfN//m7ZsmWxePHi6NWrV3zw\nwQeZFqbRunXreO+993LPAGrQBx98EDvssEPuGTXuuuuuixtvvDFWrFjxD3fofPLJJ7F8+fIYPHhw\nTJs2LdPC8uZ1POuIDz/8MPbZZ5/o2bNnHHfccbH33ntHgwYNYsaMGTF69Oj405/+VJYPc2rfvn3M\nnj079wygBlVXV0evXr1yz6hxq1evjqOPPjr23HPP+N73vheHH354tGrVKp577rkYM2ZMPPzww2X5\nLJFt2rSJ6urq3DOAGjR79uxo37597hlJXHTRRTF69OgYNGhQHHHEEbHpppvGggUL4p577on77rsv\nFi1alHtiWcv+OjFfdkrpNW1KcU8pnFTX5LrrriuGDh2a/eNzHKfmzm677VZMnz49+47Up3fv3sX4\n8eOz70h9jj/++GLMmDHZdziOU3OnUaNGxapVq5K97rDb0qV/XbyOJ/VO+/btY86cOblnADWouro6\n2rRpk3sGNcQ9nlB+Pvvss5g/f35UVVXlnkIZEZ6UNA+1hfKzZMmSWLFihfgsE127do033ngj9wyg\nhs2ePTt23nnn3DMoI8KTkrXFFltEVVVVzJo1K/cUoIZNnjw5unfvnnsG/6KKioo48MADY9KkSbmn\nADXs+eefj3333Tf3DMqI8KRk9erVK5555pmye6ZeIGLSpEnCswx07tw5Pv74Y89qC2VowoQJ0bdv\n39wzKCPCk5LVp0+fGD9+fO4ZQAITJ04UnmWge/fuMXHixNwzgASeffbZ6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vuKfwvv/rVr+IXv/hFzJgxI/cUILOzzz47unfvHoMGDco9hTpGeJLVr3/963jqqafi97//fe4p\nQAl477334oILLoh77703Nttss9xziIizzjortt9++7jmmmtyTwFKwPLly2PAgAFx/fXXxy677JJ7\nDnWI8CSbU089NTp27BjnnHNO7ilACRk9enQ888wzcffdd0eDBr5N5dS7d++48MIL48gjj4w1a9bk\nngOUiOnTp8fFF18c9913XzRp0iT3HOoI39HJYq+99oorrrgijj766Fi1alXuOUCJOfPMM6NFixZx\n5ZVX5p5Sb3Xo0CF++9vfxjHHHBPV1dW55wAl5rbbbosZM2bErbfemnsKdYTwpNZ16dIlHnnkkRgy\nZEi89dZbuecAJWjNmjXx3e9+N4455hi/R5RBy5Yt45FHHolLLrkknnnmmdxzgBJ1yimnRMeOHePa\na6/NPYU6QHhSqzp06BCPP/54nHXWWTFu3Ljcc4AS9uGHH8Zhhx0Wo0aNisMOOyz3nHqjRYsW8fjj\nj8djjz0Wt99+e+45QAn75JNP4t///d+jV69eMWzYsNxzKHGVuQdQf1RVVcUTTzwRl1xySYwdOzb3\nHKAOmDlzZhx88MHx2GOPRcOGDeOhhx7KPamstWzZMiZMmBBTp06N8847L/ccoA5YsmRJ9OnTJyZP\nnhzLli3zUit8LuFJraiqqoonn3wyRo0aFXfddVfuOUAd8tJLL0W/fv3iT3/6UzRs2DDuv//+3JPK\n0hZbbBETJkyIZ555xusqA1/JwoULo1evXjF58uRYvXp13HTTTbknUaKKUj9FUWTfUMp7SuF80TXZ\ne++9i/fee68466yzsu90HKfunq5duxbvv/9+cdxxx2XfsjGnd+/exfjx47Pv2Jiz7bbbFi+99FIx\ncuTI7Fscx6m7p127dsWsWbOKUaNGFQ0aNPjct3NbuvSvS6It+T+wuvRJKMU9pXA+75occ8wxxcKF\nC4tDDjkk+0bHcer+6dSpUzF79uziqquuKioqKrLv+aJTV8KzW7duRXV1dXHxxRdn3+I4Tt0/m2++\nefHEE08Ujz76aLHppptu8G3clt7wKaXrIjxL5JTanlI4G7oml112WTFv3ryiS5cu2fc5jlM+Z+ut\nty4mT55c/PGPfyxatmyZfc/nnboQngMHDiwWLlxY9O/fP/sWx3HK51RWVha//OUvi1dffbWoqqr6\nh793W3rDp5SuS4otntWWGrfGJP24AAAKjElEQVTlllvG/fffH4ccckjss88+8dprr+WeBJSRxYsX\nR8+ePeOdd96JF154Ibp06ZJ7Up2zySabxPXXXx9XXnll9O7dOx544IHck4AysmbNmvjBD34Qo0eP\njqlTp0a/fv1yT6JEZC/qLzulVP+luKcUzt+uybe//e3inXfeKUaNGlU0btw4+y7Hccr7HHvsscXC\nhQuLiy++uKisrMy+53+fUr3Hc4899ihee+214qGHHio233zz7Hscxynv06NHj6K6urq48cYbi002\n2aSIcFv6804pXRf3eFLymjVrFieeeGKce+658emnn+aeA5S5e+65J/bYY4/Yf//9Y9q0ae79/AKN\nGzeOq6++OsaNGxdXX311HHnkkbFkyZLcs4AyN3HixNhtt91i4cKFsWbNmtxzyCx7UX/ZKaX6L8U9\npXBcE8dxcp8TTjihWLhwYTFs2LCiSZMm2feU0j2e++67bzFz5szi/vvvL7bZZpvsexzHqd/H7cbS\nvy7u8QSAzzF69Ojo1q1bfOMb34g333wzhgwZEg0a1O9vc7vuums8+OCDce+998ZPfvKT+O53vxsL\nFizIPQuAeqh+f0cGoKy8//77MWDAgBgwYECccMIJMX369Dj00ENzz6p122+/ffzqV7+KyZMnx7PP\nPhu77rpr3HfffblnAVCPCU8Ays60adOie/fuccEFF8RVV10Vzz33XAwYMCAqKytzT0uqQ4cOceON\nN8b06dPjo48+il133TWuu+66WLVqVe5pANRzwhOAsvXYY49Ft27d4tprr40zzjgj5syZExdeeGFs\ntdVWuafVmIqKiujbt2+MGzcupkyZEkuXLo2uXbvGhRde6MmDACgZ5f2jXwDqvXXr1sWDDz4YDz74\nYHTr1i3OOuuseOutt+Lhhx+Oe++9N55++uk6+UyLbdu2jQEDBsSJJ54Yq1atihtuuCH69+/v3k0A\nSpJ7PAGoN1555ZU48cQTY9ddd43XXnstLr/88nj//ffj17/+dfTq1SsaNmyYe+IXqqqqivPOOy+m\nTZsW06ZNi5122ilOOeWU2H333WP06NGiE4CSVRH/8/S2Ja0oiqioqMg9Y71S21MKXBOgrqqqqorv\nfve7cfTRR8dOO+0UkyZNWn9mzJgR//OM8l9d7969Y+jQodG3b99/ettWW20VBxxwQHTv3j26d+8e\nrVu3jgcffDDuu+++mDhxYqxdu/afft8AubjduGGldF1SbBGe/4RS21MKXBOgHOywww7Ro0eP9aG3\n1VZbxZQpU2LatGkxa9aseP3112P27NkbFXxfNTy33nrr6NSpU3Tu3Dm6du0aBxxwQFRVVcVzzz23\nPoRffPHFOvmwYID/ze3GDSul6yI8S0Sp7SkFrglQjrbbbrs48MAD45vf/Ob6KNx+++1j9uzZ8cYb\nb8QHH3wQixYtisWLF6//86OPPoo1a9bE3nvvHUOGDIlTTjklKisro1mzZrH11ltHq1at1v/ZqlWr\naN++fXTq1CkqKyvXx+3MmTNjypQp8fLLL7tXEyg7bjduWCldl3odnqVk3rx50a5du9wzSkop/R8F\nIKUmTZrELrvsEh07doxtttnmH0Jy8803j8rKymjRokVsueWWUV1dHWvXro2VK1f+n0j92z/PnTs3\nXn/99ViwYEHuDw2gVrjduGFz586Ntm3b5p6xXr0NT/9xljafI4D/qyZ+xxOgHLndWPpSfI48qy0A\nAABJCU8AAACSEp4AAAAkJTwBAABISngCAACQlPAEAAAgKeEJAABAUsITAACApIQnAAAASQlPAAAA\nkhKeAAAAJCU8AQAASEp4AgAAkJTwBAAAICnhCQAAQFLCEwAAgKSEJwAAAEkJTwAAAJISngAAACQl\nPAEAAEhKeAIAAJCU8AQAACAp4QkAAEBSwhMAAICkhCcAAABJCU8AAACSEp4AAAAkJTwBAABISngC\nAACQlPAEAAAgKeEJAABAUsITAACApIQnAAAASQlPAAAAkhKeAAAAJCU8AQAASEp4AgAAkJTwBAAA\nICnhCQAAQFLCEwAAgKSEJwAAAEkJTwAAAJISngAAACQlPAEAAEhKeAIAAJCU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AEhKeAIAAJCU8AQAACAp4QkAAEBSwhMAAICkhCcAAABJCU8AAACSEp4AAAAk\nJTwBAABISngCAACQlPAEAAAgKeEJAABAUpW5B2yMefPmRVEUuWcAwFfm+xcAdc28efNq/H1WRITv\niAAAACTjobYAAAAkJTwBAABISngCAACQlPAEAAAgKeEJAABAUsITAACApIQnAAAASQlPAAAAkhKe\nAAAAJCU8AQAASEp4AgAAkJTwBAAAICnhCQAAQFLCEwAAgKSEJwAAAEkJTwAAAJISngAAACQlPAEA\nAEhKeAIAAJCU8AQAACAp4QkAAEBSwhMAAICkhCcAAABJCU8AAACSEp4AAAAkJTwBAABISngCAACQ\nlPAEAAAgKeEJAABAUsITAACApIQnAAAASQlPAAAAkhKeAAAAJCU8AQAASOr/ATwv/+TOheH3AAAA\nAElFTkSuQmCC\n",
"text/plain": [
"<Figure size 1152x648 with 1 Axes>"
]
},
"metadata": {
"tags": []
}
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "cTn2YICxuUdK",
"colab_type": "code",
"colab": {}
},
"source": [
"kargs = { 'duration': 2 }\n",
"import imageio\n",
"images = []\n",
"for filename in filenames:\n",
" frame = 2*(i**0.5) \n",
" images.append(imageio.imread(filename))\n",
"imageio.mimsave('movie.gif', images,**kargs)"
],
"execution_count": 0,
"outputs": []
}
]
}