sportowe_wizualizacja/BDOviz.ipynb

585 lines
311 KiB
Plaintext
Raw Normal View History

2020-02-29 15:58:59 +01:00
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# A Viz Showing The Ballon d'Or votings by players and the vote count recieved by each player for the respective position"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import json\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",
"import os\n",
"\n",
"df = pd.read_csv('Balon d\\'Or 2019 Stats - Sheet1.csv')\n",
"df = df.dropna()"
]
},
{
"cell_type": "code",
"execution_count": 2,
"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>Country</th>\n",
" <th>1</th>\n",
" <th>2</th>\n",
" <th>3</th>\n",
" <th>4</th>\n",
" <th>5</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>Albania</td>\n",
" <td>Ronaldo</td>\n",
" <td>Van Dijk</td>\n",
" <td>Messi</td>\n",
" <td>Alisson</td>\n",
" <td>Salah</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>Algeria</td>\n",
" <td>Mane</td>\n",
" <td>Messi</td>\n",
" <td>Mahrez</td>\n",
" <td>Van Dijk</td>\n",
" <td>Aguero</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>Andorra</td>\n",
" <td>Messi</td>\n",
" <td>Salah</td>\n",
" <td>Mbappe</td>\n",
" <td>De Jong</td>\n",
" <td>Ronaldo</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>Angola</td>\n",
" <td>Van Dijk</td>\n",
" <td>Ronaldo</td>\n",
" <td>Messi</td>\n",
" <td>Salah</td>\n",
" <td>Mane</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>Argentina</td>\n",
" <td>Messi</td>\n",
" <td>Ronaldo</td>\n",
" <td>Aguero</td>\n",
" <td>Van Dijk</td>\n",
" <td>Benzema</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Country 1 2 3 4 5\n",
"1 Albania Ronaldo Van Dijk Messi Alisson Salah\n",
"2 Algeria Mane Messi Mahrez Van Dijk Aguero\n",
"4 Andorra Messi Salah Mbappe De Jong Ronaldo\n",
"5 Angola Van Dijk Ronaldo Messi Salah Mane\n",
"6 Argentina Messi Ronaldo Aguero Van Dijk Benzema"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df.head()"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"df.rename(columns ={'1':'FirstChoice','2':'SecondChoice','3':'ThirdChoice','4':'FourthChoice','5':'FifthChoice'}, inplace = True)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array(['Ronaldo', 'Mane ', 'Messi ', 'Van Dijk ', 'Ronaldo ', 'Van Dijk',\n",
" 'Salah ', 'Mane', 'Messi', 'Alisson ', 'Lewandowski ', 'Mbappe ',\n",
" 'Alexander-Arnold '], dtype=object)"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df.FirstChoice.unique()"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"df['FirstChoice'] = df.FirstChoice.str.strip()\n",
"df['SecondChoice'] = df.SecondChoice.str.strip()\n",
"df['ThirdChoice'] = df.ThirdChoice.str.strip()\n",
"df['FourthChoice'] = df.FourthChoice.str.strip()\n",
"df['FifthChoice'] = df.FifthChoice.str.strip()"
]
},
{
"cell_type": "code",
"execution_count": 6,
"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>Country</th>\n",
" <th>FirstChoice</th>\n",
" <th>SecondChoice</th>\n",
" <th>ThirdChoice</th>\n",
" <th>FourthChoice</th>\n",
" <th>FifthChoice</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>Albania</td>\n",
" <td>Ronaldo</td>\n",
" <td>Van Dijk</td>\n",
" <td>Messi</td>\n",
" <td>Alisson</td>\n",
" <td>Salah</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>Algeria</td>\n",
" <td>Mane</td>\n",
" <td>Messi</td>\n",
" <td>Mahrez</td>\n",
" <td>Van Dijk</td>\n",
" <td>Aguero</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>Andorra</td>\n",
" <td>Messi</td>\n",
" <td>Salah</td>\n",
" <td>Mbappe</td>\n",
" <td>De Jong</td>\n",
" <td>Ronaldo</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>Angola</td>\n",
" <td>Van Dijk</td>\n",
" <td>Ronaldo</td>\n",
" <td>Messi</td>\n",
" <td>Salah</td>\n",
" <td>Mane</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>Argentina</td>\n",
" <td>Messi</td>\n",
" <td>Ronaldo</td>\n",
" <td>Aguero</td>\n",
" <td>Van Dijk</td>\n",
" <td>Benzema</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Country FirstChoice SecondChoice ThirdChoice FourthChoice FifthChoice\n",
"1 Albania Ronaldo Van Dijk Messi Alisson Salah\n",
"2 Algeria Mane Messi Mahrez Van Dijk Aguero\n",
"4 Andorra Messi Salah Mbappe De Jong Ronaldo\n",
"5 Angola Van Dijk Ronaldo Messi Salah Mane\n",
"6 Argentina Messi Ronaldo Aguero Van Dijk Benzema"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df.head()"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
"unique_player = set()\n",
"unique_player.update(df.FirstChoice.unique())\n",
"unique_player.update(df.SecondChoice.unique())\n",
"unique_player.update(df.ThirdChoice.unique())\n",
"unique_player.update(df.FourthChoice.unique())\n",
"unique_player.update(df.FifthChoice.unique())"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
"df_agg = pd.DataFrame(list(unique_player),columns=['Players'])#\n",
"\n",
"df_agg['First'] = ''\n",
"df_agg['Second'] = ''\n",
"df_agg['Third'] = ''\n",
"df_agg['Fourth'] = ''\n",
"df_agg['Fifth'] = ''\n"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
"for i in unique_player:\n",
" df_agg['First'][df_agg.Players == i] = df[df.FirstChoice == i].count()[0]\n",
" df_agg['Second'][df_agg.Players == i] = df[df.SecondChoice == i].count()[0]\n",
" df_agg['Third'][df_agg.Players == i] = df[df.ThirdChoice == i].count()[0]\n",
" df_agg['Fourth'][df_agg.Players == i] = df[df.FourthChoice == i].count()[0]\n",
" df_agg['Fifth'][df_agg.Players == i] = df[df.FifthChoice == i].count()[0]"
]
},
{
"cell_type": "code",
"execution_count": 11,
"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>Players</th>\n",
" <th>First</th>\n",
" <th>Second</th>\n",
" <th>Third</th>\n",
" <th>Fourth</th>\n",
" <th>Fifth</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>Tadic</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>2</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>Sterling</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>2</td>\n",
" <td>7</td>\n",
" <td>10</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>Griezmann</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>Mbappe</td>\n",
" <td>2</td>\n",
" <td>4</td>\n",
" <td>6</td>\n",
" <td>13</td>\n",
" <td>16</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>Koulibaly</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Players First Second Third Fourth Fifth\n",
"0 Tadic 0 0 0 2 1\n",
"1 Sterling 0 0 2 7 10\n",
"2 Griezmann 0 0 1 2 2\n",
"3 Mbappe 2 4 6 13 16\n",
"4 Koulibaly 0 0 0 1 0"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df_agg.head()"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [],
"source": [
"plot = df_agg.melt('Players',var_name='for hue', value_name='value')"
]
},
{
"cell_type": "code",
"execution_count": 13,
"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>Players</th>\n",
" <th>for hue</th>\n",
" <th>value</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>Tadic</td>\n",
" <td>First</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>Sterling</td>\n",
" <td>First</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>Griezmann</td>\n",
" <td>First</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>Mbappe</td>\n",
" <td>First</td>\n",
" <td>2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>Koulibaly</td>\n",
" <td>First</td>\n",
" <td>0</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Players for hue value\n",
"0 Tadic First 0\n",
"1 Sterling First 0\n",
"2 Griezmann First 0\n",
"3 Mbappe First 2\n",
"4 Koulibaly First 0"
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"plot.head()"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Text(0.5, 0, 'Players')"
]
},
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAACkUAAAZNCAYAAABxocT6AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAIABJREFUeJzs3X+M1/V9B/DX/eSO44A77oqicBsWhMbStOJAqZ1WoxVsZaDYaiPptEw2hrMxW7XZ1q5Jt5Ao2ppIs7arltp2FI2o4NHN2tkSKM0EqlVAliLqafnNAYd8j7v91abXz/fwvt/7ybuPR9JkeX4/79fnReGv5dn3p6Szs7MzAAAAAAAAAAAAAM5wpYO9AAAAAAAAAAAAAEBfUIoEAAAAAAAAAAAAkqAUCQAAAAAAAAAAACRBKRIAAAAAAAAAAABIglIkAAAAAAAAAAAAkASlSAAAAAAAAAAAACAJSpEAAAAAAAAAAABAEpQiAQAAAAAAAAAAgCQoRQIAAAAAAAAAAABJUIoEAAAAAAAAAAAAkqAUCQAAAAAAAAAAACRBKRIAAAAAAAAAAABIglIkAAAAAAAAAAAAkITywV6AdB08eCw6OjoHew0AAAAAAAAAAOiitLQk6upqBnsNoB8oRdJvOjo6lSIBAAAAAAAAAAAYMD6fDQAAAAAAAAAAACRBKRIAAAAAAAAAAABIglIkAAAAAAAAAAAAkASlSAAAAAAAAAAAACAJSpEAAAAAAAAAAABAEpQiAQAAAAAAAAAAgCQoRQIAAAAAAAAAAABJUIoEAAAAAAAAAAAAkqAUCQAAAAAAAAAAACRBKRIAAAAAAAAAAABIglIkAAAAAAAAAAAAkASlSAAAAAAAAAAAACAJSpEAAAAAAAAAAABAEpQiAQAAAAAAAAAAgCSUD/YC9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TP7mm2/2am5LS0smq6ysjPe85z29mgsAAAAAAAAAAAADRSmyH7z++uuxadOmTP7xj388KisrezW7tLQ0JkyYkMl//etf92ru7t27M1lTU1OUlJT0ai4AAAAAAAAAAAAMFKXIfvD4449HZ2dnJu/tp7N/a+rUqZnslVde6dXMl19+OZNNmTKlVzMBAAAAAAAAAABgIClF9rHOzs54/PHHM/nUqVPzlhmLMW3atEy2a9euOHr0aFHzOjs7Y+vWrT16DwAAAAAAAAAAAAxVSpF9bOPGjfHGG29k8r66JTIi4uKLL85k7e3tsXHjxqLm/epXv4oDBw5k8ksuuaSoeQAAAAAAAAAAADAYlCL72OrVqzNZZWVlfPzjH++zd0yePDnOPffcTL527dqi5uU7N378+Hjve99b1DwAAAAAAAAAAAAYDEqRfejo0aPxox/9KJNfccUVMXr06D59V76S5fr16+Ptt98uaM6JEyfyFjmvvfbaoncDAAAAAAAAAACAwaAU2YeefvrpOHHiRCafN29en79rwYIFUV5e3iXL5XLx1a9+taA53/zmN+PgwYNdsoqKirjxxht7vSMAAAAAQMpqR1ZFY2Ntj/9TO7JqsFcGAAAASF75uz9CT+W7cfGss86KD3/4w33+rnHjxsV1112XeecPf/jDuPzyy+PKK6981xnbtm2Lhx56KJNfd911cfbZZ/fZrgAAAAAAKaoaVhE3/f13e/z8o8tujtbI/g/rAQAAAOg7borsI7t27YqtW7dm8rlz50Zpaf/81/y5z30uRowYkTdvbm4+7dnNmzfHZz/72cjlcl3y2trauPPOO/t0TwAAAAAAAAAAABgISpF9JN8tkRH98+ns32poaIgvfelLmfydd96JpUuXxuLFi+PHP/5xHDhwIE6dOhWHDh2KDRs2xF133RW33HJLHDp0KHP
"text/plain": [
"<Figure size 2880x1440 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"import seaborn as sns\n",
"import matplotlib.pyplot as plt\n",
"bg = \"#181818\"\n",
"a4_dims = (40 ,20)\n",
"fig, ax = plt.subplots(figsize=a4_dims)\n",
"sns.set(rc={ 'grid.color': '#5c5b5b','grid.linestyle': ' ','axes.edgecolor': '#000000','axes.facecolor':bg, 'figure.facecolor':bg,'ytick.color':'white','xtick.color':'white' ,'axes.labelcolor': 'white','text.color': 'white'})\n",
"plt.xticks(rotation=90)\n",
"sns.set(font_scale = 5)\n",
"ax = sns.barplot(x=\"Players\", y=\"value\", hue=\"for hue\", data=plot)\n",
"plt.legend(scatterpoints=1,\n",
" bbox_to_anchor=(1, 0.7), loc=2, borderaxespad=1.,\n",
" ncol=1,\n",
" fontsize=29)\n",
"plt.xlabel('Players', fontsize=16)\n",
"#plt.ylabel('Vote Count', fontsize=16)"
]
}
],
"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.9"
}
},
"nbformat": 4,
"nbformat_minor": 2
}