2022-10-18 00:24:12 +02:00
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Analiza zależności ilości kibiców w baseball mlb"
]
},
{
"cell_type": "code",
2022-10-18 17:35:27 +02:00
"execution_count": 5,
2022-10-18 00:24:12 +02:00
"metadata": {},
"outputs": [
{
2022-10-18 17:35:27 +02:00
"output_type": "execute_result",
2022-10-18 00:24:12 +02:00
"data": {
"text/plain": [
" Unnamed: 0 attendance away_team away_team_errors \\\n",
"0 0 40030.0 New York Mets 1 \n",
"1 1 21621.0 Philadelphia Phillies 0 \n",
"2 2 12622.0 Minnesota Twins 0 \n",
"3 3 18531.0 Washington Nationals 0 \n",
"4 4 18572.0 Colorado Rockies 1 \n",
"... ... ... ... ... \n",
"2458 2458 31042.0 Toronto Blue Jays 2 \n",
"2459 2459 39500.0 St. Louis Cardinals 0 \n",
"2460 2460 20098.0 San Francisco Giants 0 \n",
"2461 2461 17883.0 Detroit Tigers 0 \n",
"2462 2462 10298.0 Boston Red Sox 1 \n",
"\n",
" away_team_hits away_team_runs date field_type game_type \\\n",
"0 7 3 2016-04-03 on grass Night Game \n",
"1 5 2 2016-04-06 on grass Night Game \n",
"2 5 2 2016-04-06 on grass Night Game \n",
"3 8 3 2016-04-06 on grass Night Game \n",
"4 8 4 2016-04-06 on grass Day Game \n",
"... ... ... ... ... ... \n",
"2458 7 5 2016-04-03 on turf Day Game \n",
"2459 5 1 2016-04-03 on grass Day Game \n",
"2460 6 3 2016-04-06 on grass Day Game \n",
"2461 13 7 2016-04-06 on grass Day Game \n",
"2462 10 6 2016-04-06 on grass Night Game \n",
"\n",
" home_team ... temperature wind_speed \\\n",
"0 Kansas City Royals ... 74.0 14.0 \n",
"1 Cincinnati Reds ... 55.0 24.0 \n",
"2 Baltimore Orioles ... 48.0 7.0 \n",
"3 Atlanta Braves ... 65.0 10.0 \n",
"4 Arizona Diamondbacks ... 77.0 0.0 \n",
"... ... ... ... ... \n",
"2458 Tampa Bay Rays ... 72.0 0.0 \n",
"2459 Pittsburgh Pirates ... 39.0 14.0 \n",
"2460 Milwaukee Brewers ... 66.0 0.0 \n",
"2461 Miami Marlins ... 71.0 0.0 \n",
"2462 Cleveland Indians ... 60.0 7.0 \n",
"\n",
" wind_direction sky total_runs game_hours_dec \\\n",
"0 from Right to Left Sunny 7 3.216667 \n",
"1 from Right to Left Overcast 5 2.383333 \n",
"2 out to Leftfield Unknown 6 3.183333 \n",
"3 from Right to Left Cloudy 4 2.883333 \n",
"4 in unknown direction In Dome 7 2.650000 \n",
"... ... ... ... ... \n",
"2458 in unknown direction In Dome 8 2.850000 \n",
"2459 out to Leftfield Unknown 5 3.033333 \n",
"2460 in unknown direction In Dome 7 3.316667 \n",
"2461 in unknown direction In Dome 10 3.366667 \n",
"2462 out to Leftfield Unknown 13 3.483333 \n",
"\n",
" season home_team_win home_team_loss home_team_outcome \n",
"0 regular season 1 0 Win \n",
"1 regular season 1 0 Win \n",
"2 regular season 1 0 Win \n",
"3 regular season 0 1 Loss \n",
"4 regular season 0 1 Loss \n",
"... ... ... ... ... \n",
"2458 regular season 0 1 Loss \n",
"2459 regular season 1 0 Win \n",
"2460 regular season 1 0 Win \n",
"2461 regular season 0 1 Loss \n",
"2462 regular season 1 0 Win \n",
"\n",
"[2463 rows x 26 columns]"
2022-10-18 17:35:27 +02:00
],
"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>Unnamed: 0</th>\n <th>attendance</th>\n <th>away_team</th>\n <th>away_team_errors</th>\n <th>away_team_hits</th>\n <th>away_team_runs</th>\n <th>date</th>\n <th>field_type</th>\n <th>game_type</th>\n <th>home_team</th>\n <th>...</th>\n <th>temperature</th>\n <th>wind_speed</th>\n <th>wind_direction</th>\n <th>sky</th>\n <th>total_runs</th>\n <th>game_hours_dec</th>\n <th>season</th>\n <th>home_team_win</th>\n <th>home_team_loss</th>\n <th>home_team_outcome</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>0</th>\n <td>0</td>\n <td>40030.0</td>\n <td>New York Mets</td>\n <td>1</td>\n <td>7</td>\n <td>3</td>\n <td>2016-04-03</td>\n <td>on grass</td>\n <td>Night Game</td>\n <td>Kansas City Royals</td>\n <td>...</td>\n <td>74.0</td>\n <td>14.0</td>\n <td>from Right to Left</td>\n <td>Sunny</td>\n <td>7</td>\n <td>3.216667</td>\n <td>regular season</td>\n <td>1</td>\n <td>0</td>\n <td>Win</td>\n </tr>\n <tr>\n <th>1</th>\n <td>1</td>\n <td>21621.0</td>\n <td>Philadelphia Phillies</td>\n <td>0</td>\n <td>5</td>\n <td>2</td>\n <td>2016-04-06</td>\n <td>on grass</td>\n <td>Night Game</td>\n <td>Cincinnati Reds</td>\n <td>...</td>\n <td>55.0</td>\n <td>24.0</td>\n <td>from Right to Left</td>\n <td>Overcast</td>\n <td>5</td>\n <td>2.383333</td>\n <td>regular season</td>\n <td>1</td>\n <td>0</td>\n <td>Win</td>\n </tr>\n <tr>\n <th>2</th>\n <td>2</td>\n <td>12622.0</td>\n <td>Minnesota Twins</td>\n <td>0</td>\n <td>5</td>\n <td>2</td>\n <td>2016-04-06</td>\n <td>on grass</td>\n <td>Night Game</td>\n <td>Baltimore Orioles</td>\n <td>...</td>\n <td>48.0</td>\n <td>7.0</td>\n <td>out to Leftfield</td>\n <td>Unknown</td>\n <td>6</td>\n <td>3.183333</td>\n <td>regular season</td>\n <td>1</td>\n <td>0</td>\n <td>Win</td>\n </tr>\n <tr>\n <th>3</th>\n <td>3</td>\n <td>18531.0</td>\n <td>Washington Nationals</td>\n <td>0</td>\n <td>8</td>\n <td>3</td>\n <td>2016-04-06</td>\n <td>on grass</td>\n <td>Night Game</td>\n <td>Atlanta Braves</td>\n <td>...</td>\n <td>65.0</td>\n <td>10.0</td>\n <td>from Right to Left</td>\n <td>Cloudy</td>\n <td>4</td>\n <td>2.883333</td>\n <td>regular season</td>\n <td>0</td>\n <td>1</td>\n <td>Loss</td>\n </tr>\n <tr>\n <th>4</th>\n <td>4</td>\n <td>18572.0</td>\n <td>Colorado Rockies</td>\n <td>1</td>\n <td>8</td>\n <td>4</td>\n <td>2016-04-06</td>\n <td>on grass</td>\n <td>Day Game</td>\n <td>Arizona Diamondbacks</td>\n <td>...</td>\n <td>77.0</td>\n <td>0.0</td>\n <td>in unknown direction</td>\n <td>In Dome</td>\n <td>7</td>\n <td>2.650000</td>\n <td>regular season</td>\n <td>0</td>\n <td>1</td>\n <td>Loss</td>\n </tr>\n <tr>\n <th>...</th>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</t
2022-10-18 00:24:12 +02:00
},
"metadata": {},
2022-10-18 17:35:27 +02:00
"execution_count": 5
2022-10-18 00:24:12 +02:00
}
],
"source": [
"import pandas as pd\n",
"\n",
"data = pd.read_csv(\"baseball_reference_2016_clean.csv\")\n",
"\n",
"data"
]
},
2022-10-18 17:35:27 +02:00
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"Index(['Unnamed: 0', 'attendance', 'away_team', 'away_team_errors',\n",
" 'away_team_hits', 'away_team_runs', 'date', 'field_type', 'game_type',\n",
" 'home_team', 'home_team_errors', 'home_team_hits', 'home_team_runs',\n",
" 'start_time', 'venue', 'day_of_week', 'temperature', 'wind_speed',\n",
" 'wind_direction', 'sky', 'total_runs', 'game_hours_dec', 'season',\n",
" 'home_team_win', 'home_team_loss', 'home_team_outcome'],\n",
" dtype='object')"
]
},
"metadata": {},
"execution_count": 6
}
],
"source": [
"data.columns"
]
},
2022-10-18 00:24:12 +02:00
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Pogoda\n",
"\n",
"![image](sky.jpg)"
]
},
{
"cell_type": "code",
2022-10-18 17:35:27 +02:00
"execution_count": 7,
2022-10-18 00:24:12 +02:00
"metadata": {},
"outputs": [
{
2022-10-18 17:35:27 +02:00
"output_type": "execute_result",
2022-10-18 00:24:12 +02:00
"data": {
"text/plain": [
"array(['Sunny', 'Overcast', 'Unknown', 'Cloudy', 'In Dome', 'Drizzle',\n",
" 'Rain', 'Night'], dtype=object)"
]
},
"metadata": {},
2022-10-18 17:35:27 +02:00
"execution_count": 7
2022-10-18 00:24:12 +02:00
}
],
"source": [
"data['sky'].unique()"
]
},
{
"cell_type": "code",
2022-10-18 17:35:27 +02:00
"execution_count": 8,
2022-10-18 00:24:12 +02:00
"metadata": {},
"outputs": [],
"source": [
"sunny = data[data['sky'] == 'Sunny']\n",
"overcast = data[data['sky'] == 'Overcast']\n",
"cloudy = data[data['sky'] == 'Cloudy']\n",
"in_dome = data[data['sky'] == 'In Dome']\n",
"drizzle = data[data['sky'] == 'Drizzle']\n",
"rain = data[data['sky'] == 'Rain']\n",
"night = data[data['sky'] == 'Night']"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Średnia ilość kibiców w zależności od pogody"
]
},
{
"cell_type": "code",
2022-10-18 17:35:27 +02:00
"execution_count": 9,
2022-10-18 00:24:12 +02:00
"metadata": {},
"outputs": [
{
2022-10-18 17:35:27 +02:00
"output_type": "display_data",
2022-10-18 00:24:12 +02:00
"data": {
2022-10-18 17:35:27 +02:00
"text/plain": "<Figure size 432x288 with 1 Axes>",
"image/svg+xml": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<svg xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"401.690625pt\" height=\"277.314375pt\" viewBox=\"0 0 401.690625 277.314375\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">\n <metadata>\n <rdf:RDF xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n <cc:Work>\n <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n <dc:date>2022-10-18T17:29:42.935602</dc:date>\n <dc:format>image/svg+xml</dc:format>\n <dc:creator>\n <cc:Agent>\n <dc:title>Matplotlib v3.5.1, https://matplotlib.org/</dc:title>\n </cc:Agent>\n </dc:creator>\n </cc:Work>\n </rdf:RDF>\n </metadata>\n <defs>\n <style type=\"text/css\">*{stroke-linejoin: round; stroke-linecap: butt}</style>\n </defs>\n <g id=\"figure_1\">\n <g id=\"patch_1\">\n <path d=\"M 0 277.314375 \nL 401.690625 277.314375 \nL 401.690625 0 \nL 0 0 \nL 0 277.314375 \nz\n\" style=\"fill: none\"/>\n </g>\n <g id=\"axes_1\">\n <g id=\"patch_2\">\n <path d=\"M 59.690625 239.758125 \nL 394.490625 239.758125 \nL 394.490625 22.318125 \nL 59.690625 22.318125 \nz\n\" style=\"fill: #ffffff\"/>\n </g>\n <g id=\"patch_3\">\n <path d=\"M 74.908807 239.758125 \nL 110.716293 239.758125 \nL 110.716293 88.684867 \nL 74.908807 88.684867 \nz\n\" clip-path=\"url(#p330f00376d)\" style=\"fill: #0000ff\"/>\n </g>\n <g id=\"patch_4\">\n <path d=\"M 119.668165 239.758125 \nL 155.475652 239.758125 \nL 155.475652 110.336237 \nL 119.668165 110.336237 \nz\n\" clip-path=\"url(#p330f00376d)\" style=\"fill: #008000\"/>\n </g>\n <g id=\"patch_5\">\n <path d=\"M 164.427523 239.758125 \nL 200.23501 239.758125 \nL 200.23501 97.789682 \nL 164.427523 97.789682 \nz\n\" clip-path=\"url(#p330f00376d)\" style=\"fill: #ff0000\"/>\n </g>\n <g id=\"patch_6\">\n <path d=\"M 209.186882 239.758125 \nL 244.994368 239.758125 \nL 244.994368 126.086667 \nL 209.186882 126.086667 \nz\n\" clip-path=\"url(#p330f00376d)\" style=\"fill: #0000ff\"/>\n </g>\n <g id=\"patch_7\">\n <path d=\"M 253.94624 239.758125 \nL 289.753727 239.758125 \nL 289.753727 89.816989 \nL 253.94624 89.816989 \nz\n\" clip-path=\"url(#p330f00376d)\" style=\"fill: #008000\"/>\n </g>\n <g id=\"patch_8\">\n <path d=\"M 298.705598 239.758125 \nL 334.513085 239.758125 \nL 334.513085 122.731215 \nL 298.705598 122.731215 \nz\n\" clip-path=\"url(#p330f00376d)\" style=\"fill: #ff0000\"/>\n </g>\n <g id=\"patch_9\">\n <path d=\"M 343.464957 239.758125 \nL 379.272443 239.758125 \nL 379.272443 32.672411 \nL 343.464957 32.672411 \nz\n\" clip-path=\"url(#p330f00376d)\" style=\"fill: #0000ff\"/>\n </g>\n <g id=\"matplotlib.axis_1\">\n <g id=\"xtick_1\">\n <g id=\"line2d_1\">\n <defs>\n <path id=\"ma612aa19c5\" d=\"M 0 0 \nL 0 3.5 \n\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n </defs>\n <g>\n <use xlink:href=\"#ma612aa19c5\" x=\"92.81255\" y=\"239.758125\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n </g>\n </g>\n <g id=\"text_1\">\n <!-- sunny -->\n <g transform=\"translate(77.742238 254.356562)scale(0.1 -0.1)\">\n <defs>\n <path id=\"DejaVuSans-73\" d=\"M 2834 3397 \nL 2834 2853 \nQ 2591 2978 2328 3040 \nQ 2066 3103 1784 3103 \nQ 1356 3103 1142 2972 \nQ 928 2841 928 2578 \nQ 928 2378 1081 2264 \nQ 1234 2150 1697 2047 \nL 1894 2003 \nQ 2506 1872 2764 1633 \nQ 3022 1394 3022 966 \nQ 3022 478 2636 193 \nQ 2250 -91 1575 -91 \nQ 1294 -91 989 -36 \nQ 684 19 347 128 \nL 347 722 \nQ 666 556 975 473 \nQ 1284 391 1588 391 \nQ 1994 391 2212 530 \nQ 2431 669 2431 922 \nQ 2431 1156 2273 1281 \nQ 2116 1406 1581 1522 \nL 1381 1569 \nQ 847 1681 609 1914 \nQ 372 2147 372 2553 \nQ 372 3047 722 3315 \nQ 1072 3584 1716 3584 \nQ 2034 3584 2315 3537 \nQ 2597 3491 2834 3397 \nz\n\" transform=\"scale(0.015625)\"/>\n
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAZEAAAEWCAYAAACnlKo3AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAfuElEQVR4nO3debwcZZ3v8c83YZclYAKDCRDEoAaECJFNQBREgrLcGVAUJSwXhgsqjKKg1xkEwQGdEeQKyGoAFwjKJoqBF7sghBNI2AISWQyZCIGEEECBwO/+Ub+Goulz0qdyus9pzvf9evXrVD3PU1W/qu7Tv66nqp9WRGBmZlbFkP4OwMzMOpeTiJmZVeYkYmZmlTmJmJlZZU4iZmZWmZOImZlV5iRi1oCk0ZJC0jL9HUsnkPS4pJ36Ow5rPycRG1Ak3SRpgaTl68rf8iblN/m3krS1pEWShpbKzumm7KdLua1Jkk5YmnXYO4eTiA0YkkYD2wEB7N6/0XScLor/581KZdsBT9aVbQ/c0sa4esUfCjqPk4gNJPsBdwCTgIm1QkkXAesCv5X0gqRv8uYb4XNZtnW2PVDSzDybmSJpvdJ6QtKhkh6R9Jyk0yUp64ZK+i9Jz0h6FPh0OTBJB+R6F0l6VNK/lup2kPSkpK9LelrSXEkHlOpXlPTfkp6QtFDSHyWtmHVbSbo945khaYcqBy4iXs1jt32ud01gOWByXdmGwC2Shkg6RtJfJD0rabKkNUoxXyrpbxnvLZI2yvJDgH2Bb+Zx/20pjHGS7s1lLpG0Qml9n5E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dJRLOHLVJJuBr4BnBURH86y+yNi4zbE1+fGjx8fXV1dlZb
2022-10-18 00:24:12 +02:00
},
"metadata": {
"needs_background": "light"
2022-10-18 17:35:27 +02:00
}
2022-10-18 00:24:12 +02:00
}
],
"source": [
"import matplotlib.pyplot as plt\n",
" \n",
"left = [1, 2, 3, 4, 5, 6, 7]\n",
"\n",
"height = [sunny['attendance'].mean(), overcast['attendance'].mean(), cloudy['attendance'].mean(), \n",
"in_dome['attendance'].mean(), drizzle['attendance'].mean(), rain['attendance'].mean(), night['attendance'].mean()]\n",
"\n",
"tick_label = ['sunny', 'overcast', 'cloudy', 'in dome', 'drizzle', 'rain', 'night']\n",
"\n",
"plt.bar(left, height, tick_label = tick_label,\n",
" width = 0.8, color = ['blue', 'green', 'red'])\n",
" \n",
"plt.xlabel('Weather')\n",
"plt.ylabel('Attendance')\n",
"plt.title('Attendance - Weather')\n",
"\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Mediana"
]
},
{
"cell_type": "code",
2022-10-18 17:35:27 +02:00
"execution_count": 10,
2022-10-18 00:24:12 +02:00
"metadata": {},
"outputs": [
{
2022-10-18 17:35:27 +02:00
"output_type": "display_data",
2022-10-18 00:24:12 +02:00
"data": {
2022-10-18 17:35:27 +02:00
"text/plain": "<Figure size 432x288 with 1 Axes>",
"image/svg+xml": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<svg xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"401.690625pt\" height=\"277.314375pt\" viewBox=\"0 0 401.690625 277.314375\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">\n <metadata>\n <rdf:RDF xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n <cc:Work>\n <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n <dc:date>2022-10-18T17:29:48.241904</dc:date>\n <dc:format>image/svg+xml</dc:format>\n <dc:creator>\n <cc:Agent>\n <dc:title>Matplotlib v3.5.1, https://matplotlib.org/</dc:title>\n </cc:Agent>\n </dc:creator>\n </cc:Work>\n </rdf:RDF>\n </metadata>\n <defs>\n <style type=\"text/css\">*{stroke-linejoin: round; stroke-linecap: butt}</style>\n </defs>\n <g id=\"figure_1\">\n <g id=\"patch_1\">\n <path d=\"M 0 277.314375 \nL 401.690625 277.314375 \nL 401.690625 0 \nL 0 0 \nL 0 277.314375 \nz\n\" style=\"fill: none\"/>\n </g>\n <g id=\"axes_1\">\n <g id=\"patch_2\">\n <path d=\"M 59.690625 239.758125 \nL 394.490625 239.758125 \nL 394.490625 22.318125 \nL 59.690625 22.318125 \nz\n\" style=\"fill: #ffffff\"/>\n </g>\n <g id=\"patch_3\">\n <path d=\"M 74.908807 239.758125 \nL 110.716293 239.758125 \nL 110.716293 77.559213 \nL 74.908807 77.559213 \nz\n\" clip-path=\"url(#p741da212ac)\" style=\"fill: #0000ff\"/>\n </g>\n <g id=\"patch_4\">\n <path d=\"M 119.668165 239.758125 \nL 155.475652 239.758125 \nL 155.475652 108.959825 \nL 119.668165 108.959825 \nz\n\" clip-path=\"url(#p741da212ac)\" style=\"fill: #008000\"/>\n </g>\n <g id=\"patch_5\">\n <path d=\"M 164.427523 239.758125 \nL 200.23501 239.758125 \nL 200.23501 90.34015 \nL 164.427523 90.34015 \nz\n\" clip-path=\"url(#p741da212ac)\" style=\"fill: #ff0000\"/>\n </g>\n <g id=\"patch_6\">\n <path d=\"M 209.186882 239.758125 \nL 244.994368 239.758125 \nL 244.994368 125.199866 \nL 209.186882 125.199866 \nz\n\" clip-path=\"url(#p741da212ac)\" style=\"fill: #0000ff\"/>\n </g>\n <g id=\"patch_7\">\n <path d=\"M 253.94624 239.758125 \nL 289.753727 239.758125 \nL 289.753727 76.112722 \nL 253.94624 76.112722 \nz\n\" clip-path=\"url(#p741da212ac)\" style=\"fill: #008000\"/>\n </g>\n <g id=\"patch_8\">\n <path d=\"M 298.705598 239.758125 \nL 334.513085 239.758125 \nL 334.513085 122.011828 \nL 298.705598 122.011828 \nz\n\" clip-path=\"url(#p741da212ac)\" style=\"fill: #ff0000\"/>\n </g>\n <g id=\"patch_9\">\n <path d=\"M 343.464957 239.758125 \nL 379.272443 239.758125 \nL 379.272443 32.672411 \nL 343.464957 32.672411 \nz\n\" clip-path=\"url(#p741da212ac)\" style=\"fill: #0000ff\"/>\n </g>\n <g id=\"matplotlib.axis_1\">\n <g id=\"xtick_1\">\n <g id=\"line2d_1\">\n <defs>\n <path id=\"m4042d5a76e\" d=\"M 0 0 \nL 0 3.5 \n\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n </defs>\n <g>\n <use xlink:href=\"#m4042d5a76e\" x=\"92.81255\" y=\"239.758125\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n </g>\n </g>\n <g id=\"text_1\">\n <!-- sunny -->\n <g transform=\"translate(77.742238 254.356562)scale(0.1 -0.1)\">\n <defs>\n <path id=\"DejaVuSans-73\" d=\"M 2834 3397 \nL 2834 2853 \nQ 2591 2978 2328 3040 \nQ 2066 3103 1784 3103 \nQ 1356 3103 1142 2972 \nQ 928 2841 928 2578 \nQ 928 2378 1081 2264 \nQ 1234 2150 1697 2047 \nL 1894 2003 \nQ 2506 1872 2764 1633 \nQ 3022 1394 3022 966 \nQ 3022 478 2636 193 \nQ 2250 -91 1575 -91 \nQ 1294 -91 989 -36 \nQ 684 19 347 128 \nL 347 722 \nQ 666 556 975 473 \nQ 1284 391 1588 391 \nQ 1994 391 2212 530 \nQ 2431 669 2431 922 \nQ 2431 1156 2273 1281 \nQ 2116 1406 1581 1522 \nL 1381 1569 \nQ 847 1681 609 1914 \nQ 372 2147 372 2553 \nQ 372 3047 722 3315 \nQ 1072 3584 1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nV5iRiZma1OYmYmVltTiJmZlabk4iZmdXmJGJmZrU5iZiZWW1OImZmVtuyAx2AmbWfjtVAh/AGcUwMdAhWk/dEzMysNu+J9IEG1483wj/ezGyAeU/EzMxqcxIxM7PanETMzKw2JxEzM6vNScTMzGpzEjEzs9qcRMzMrDYnETMzq81JxMzManMSMTOz2pxEzMysNvedZYOLOygz6yjeEzEzs9qcRMzMrLaWJRFJK0qaKmmGpHskHZvl60u6VdJsSRdJWj7LV8jx2Vk/qjKvo7P8fkmfrJTvnGWzJR3VqnUxM7PutXJP5AXg4xGxGTAG2FnSVsBJwMkR8W5gAXBAtj8AWJDlJ2c7JG0E7AVsDOwMnC5piKQhwGnAOGAj4PPZ1szM2qRlSSSKZ3N0uXwF8HHgN1l+HrB7Du+W42T9DpKU5RdGxAsR8RAwG/hQvmZHxIMR8SJwYbY1M7M2aek5kdxjuBN4HJgC/AV4OiJeziZzgRE5PAKYA5D1C4G3V8u7TNNTeXdxHCRpmqRp8+fP74c1MzMzaHESiYhXImIMMJKy5/DeVi6vlzjOjIixETF2+PDhAxGCmdlbUluuzoqIp4Frga2BoZIa96eMBObl8DxgXYCsXx14slreZZqeys3MrE1aeXXWcElDc3gl4BPALEoy2SObjQcuy+FJOU7WXxMRkeV75dVb6wOjganAbcDovNprecrJ90mtWh8zM3uzVt6xvg5wXl5FtQwwMSIul3QvcKGk44E7gHOy/TnABZJmA09RkgIRcY+kicC9wMvAoRHxCoCkLwOTgSHAuRFxTwvXx8zMumhZEomImcAHuil/kHJ+pGv5P4A9e5jXCcAJ3ZRfAVyxxMGamVktvmPdzMxqcxIxM7PanETMzKw2JxEzM6ttsUlE0oaSrpZ0d45vKulbrQ/NzMw
2022-10-18 00:24:12 +02:00
},
"metadata": {
"needs_background": "light"
2022-10-18 17:35:27 +02:00
}
2022-10-18 00:24:12 +02:00
}
],
"source": [
"import matplotlib.pyplot as plt\n",
" \n",
"left = [1, 2, 3, 4, 5, 6, 7]\n",
"\n",
"height = [sunny['attendance'].median(), overcast['attendance'].median(), cloudy['attendance'].median(), \n",
"in_dome['attendance'].median(), drizzle['attendance'].median(), rain['attendance'].median(), night['attendance'].median()]\n",
"\n",
"tick_label = ['sunny', 'overcast', 'cloudy', 'in dome', 'drizzle', 'rain', 'night']\n",
"\n",
"plt.bar(left, height, tick_label = tick_label,\n",
" width = 0.8, color = ['blue', 'green', 'red'])\n",
" \n",
"plt.xlabel('Weather')\n",
"plt.ylabel('Attendance')\n",
"plt.title('Attendance - Weather')\n",
"\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"W nocy prawdopodobnie najwięcej, gdyż większa grupa odbiorców ma dostęp do meczy online z całego świata. \n",
"Pod kopułą może być najmniej widzów, gdyż takie stadiony mają mniejsze trybuny."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Dzień tygodnia\n",
"\n",
"![image2](week.jpg)"
]
},
{
"cell_type": "code",
2022-10-18 17:35:27 +02:00
"execution_count": 11,
2022-10-18 00:24:12 +02:00
"metadata": {},
"outputs": [
{
2022-10-18 17:35:27 +02:00
"output_type": "execute_result",
2022-10-18 00:24:12 +02:00
"data": {
"text/plain": [
"array(['Sunday', 'Wednesday', 'Tuesday', 'Monday', 'Thursday', 'Saturday',\n",
" 'Friday'], dtype=object)"
]
},
"metadata": {},
2022-10-18 17:35:27 +02:00
"execution_count": 11
2022-10-18 00:24:12 +02:00
}
],
"source": [
"data['day_of_week'].unique()"
]
},
{
"cell_type": "code",
2022-10-18 17:35:27 +02:00
"execution_count": 17,
2022-10-18 00:24:12 +02:00
"metadata": {},
"outputs": [],
"source": [
"monday = data[data['day_of_week'] == 'Monday']\n",
"tuesday = data[data['day_of_week'] == 'Tuesday']\n",
"wednesday = data[data['day_of_week'] == 'Wednesday']\n",
"thursday = data[data['day_of_week'] == 'Thursday']\n",
"friday = data[data['day_of_week'] == 'Friday']\n",
"saturday = data[data['day_of_week'] == 'Saturday']\n",
"sunday = data[data['day_of_week'] == 'Sunday']"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Średnia ilość kibiców w danym dniu"
]
},
{
"cell_type": "code",
2022-10-18 17:35:27 +02:00
"execution_count": 13,
2022-10-18 00:24:12 +02:00
"metadata": {},
"outputs": [
{
2022-10-18 17:35:27 +02:00
"output_type": "display_data",
2022-10-18 00:24:12 +02:00
"data": {
2022-10-18 17:35:27 +02:00
"text/plain": "<Figure size 432x288 with 1 Axes>",
"image/svg+xml": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<svg xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"401.690625pt\" height=\"277.314375pt\" viewBox=\"0 0 401.690625 277.314375\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">\n <metadata>\n <rdf:RDF xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n <cc:Work>\n <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n <dc:date>2022-10-18T17:29:53.431566</dc:date>\n <dc:format>image/svg+xml</dc:format>\n <dc:creator>\n <cc:Agent>\n <dc:title>Matplotlib v3.5.1, https://matplotlib.org/</dc:title>\n </cc:Agent>\n </dc:creator>\n </cc:Work>\n </rdf:RDF>\n </metadata>\n <defs>\n <style type=\"text/css\">*{stroke-linejoin: round; stroke-linecap: butt}</style>\n </defs>\n <g id=\"figure_1\">\n <g id=\"patch_1\">\n <path d=\"M 0 277.314375 \nL 401.690625 277.314375 \nL 401.690625 0 \nL 0 0 \nL 0 277.314375 \nz\n\" style=\"fill: none\"/>\n </g>\n <g id=\"axes_1\">\n <g id=\"patch_2\">\n <path d=\"M 59.690625 239.758125 \nL 394.490625 239.758125 \nL 394.490625 22.318125 \nL 59.690625 22.318125 \nz\n\" style=\"fill: #ffffff\"/>\n </g>\n <g id=\"patch_3\">\n <path d=\"M 74.908807 239.758125 \nL 110.716293 239.758125 \nL 110.716293 72.223584 \nL 74.908807 72.223584 \nz\n\" clip-path=\"url(#pb63ca23451)\" style=\"fill: #0000ff\"/>\n </g>\n <g id=\"patch_4\">\n <path d=\"M 119.668165 239.758125 \nL 155.475652 239.758125 \nL 155.475652 78.038631 \nL 119.668165 78.038631 \nz\n\" clip-path=\"url(#pb63ca23451)\" style=\"fill: #008000\"/>\n </g>\n <g id=\"patch_5\">\n <path d=\"M 164.427523 239.758125 \nL 200.23501 239.758125 \nL 200.23501 75.612156 \nL 164.427523 75.612156 \nz\n\" clip-path=\"url(#pb63ca23451)\" style=\"fill: #ff0000\"/>\n </g>\n <g id=\"patch_6\">\n <path d=\"M 209.186882 239.758125 \nL 244.994368 239.758125 \nL 244.994368 70.426757 \nL 209.186882 70.426757 \nz\n\" clip-path=\"url(#pb63ca23451)\" style=\"fill: #0000ff\"/>\n </g>\n <g id=\"patch_7\">\n <path d=\"M 253.94624 239.758125 \nL 289.753727 239.758125 \nL 289.753727 49.207399 \nL 253.94624 49.207399 \nz\n\" clip-path=\"url(#pb63ca23451)\" style=\"fill: #008000\"/>\n </g>\n <g id=\"patch_8\">\n <path d=\"M 298.705598 239.758125 \nL 334.513085 239.758125 \nL 334.513085 32.672411 \nL 298.705598 32.672411 \nz\n\" clip-path=\"url(#pb63ca23451)\" style=\"fill: #ff0000\"/>\n </g>\n <g id=\"patch_9\">\n <path d=\"M 343.464957 239.758125 \nL 379.272443 239.758125 \nL 379.272443 44.038529 \nL 343.464957 44.038529 \nz\n\" clip-path=\"url(#pb63ca23451)\" style=\"fill: #0000ff\"/>\n </g>\n <g id=\"matplotlib.axis_1\">\n <g id=\"xtick_1\">\n <g id=\"line2d_1\">\n <defs>\n <path id=\"m9ab2bc8675\" d=\"M 0 0 \nL 0 3.5 \n\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n </defs>\n <g>\n <use xlink:href=\"#m9ab2bc8675\" x=\"92.81255\" y=\"239.758125\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n </g>\n </g>\n <g id=\"text_1\">\n <!-- monday -->\n <g transform=\"translate(72.516456 254.356562)scale(0.1 -0.1)\">\n <defs>\n <path id=\"DejaVuSans-6d\" d=\"M 3328 2828 \nQ 3544 3216 3844 3400 \nQ 4144 3584 4550 3584 \nQ 5097 3584 5394 3201 \nQ 5691 2819 5691 2113 \nL 5691 0 \nL 5113 0 \nL 5113 2094 \nQ 5113 2597 4934 2840 \nQ 4756 3084 4391 3084 \nQ 3944 3084 3684 2787 \nQ 3425 2491 3425 1978 \nL 3425 0 \nL 2847 0 \nL 2847 2094 \nQ 2847 2600 2669 2842 \nQ 2491 3084 2119 3084 \nQ 1678 3084 1418 2786 \nQ 1159 2488 1159 1978 \nL 1159 0 \nL 581 0 \nL 581 3500 \nL 1159 3500 \nL 1159 2956 \nQ 1356 3278 1631 3431 \nQ 1906 3584 2284 3584 \nQ 2666 3584 2933 3390 \nQ 3200 3197 3328 2828 \nz\n\" transform=\"scale(0.015625)\"/>\n <path id=\"DejaVuSans-6f\" d=\"M 1959 3097 \nQ 1497 3097 1228 2736 \nQ 959 2375 95
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAZEAAAEWCAYAAACnlKo3AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAiy0lEQVR4nO3deZgV5Zn38e9PRMQVl45jQMUo0aBGoj2KiUmMK5gFJq86Go2EeIX4qmP2UTOZ4JrEZBIzGDUvRgK4oaOJMopBLvfEIKAii0vsoAYIKsqm4obe7x/P07Fsu5tD0ed0H/v3ua66uuqu7a6iOPd5qupUKSIwMzMrY4POTsDMzOqXi4iZmZXmImJmZqW5iJiZWWkuImZmVpqLiJmZle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dPM7N3cEjEzs9JcRMzMrDQXETMzK83XRKxr8YUns7riloiZmZXmlsj7nM7pOt/sY7S/1Zu937glYmZmpbmImJlZaS4iZmZWmouImZmV5iJiZmaluYiYmVlpLiJmZlaai4iZmZXmImJmZqVVrYhI2kHSXZIelTRf0jdy/GxJiyXNzt2RhXnOktQk6QlJRxTiQ3KsSdKZhfjOkh7I8eskbVSt7TEzs/eqZktkDfCdiBgIDAZOlTQwj7soIgblbgpAHncssAcwBLhUUg9JPYBLgKHAQOC4wnIuzMvaFVgOnFTF7TEzsxaqVkQiYklEPJT7XwIeA/q2M8swYFJEvB4RTwFNwH65a4qIBRHxBjAJGCZJwMHADXn+CcDwqmyMmZm1qibXRCT1Bz4GPJBDp0maI2mcpK1yrC+wsDDbohxrK74NsCIi1rSIt7b+UZJmSZq1dOnSjtgkMzOjBkV
2022-10-18 00:24:12 +02:00
},
"metadata": {
"needs_background": "light"
2022-10-18 17:35:27 +02:00
}
2022-10-18 00:24:12 +02:00
}
],
"source": [
"import matplotlib.pyplot as plt\n",
" \n",
"left = [1, 2, 3, 4, 5, 6, 7]\n",
"\n",
"height = [monday['attendance'].mean(), tuesday['attendance'].mean(), wednesday['attendance'].mean(), \n",
"thursday['attendance'].mean(), friday['attendance'].mean(), saturday['attendance'].mean(), sunday['attendance'].mean()]\n",
"\n",
"tick_label = ['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday']\n",
"\n",
"plt.bar(left, height, tick_label = tick_label,\n",
" width = 0.8, color = ['blue', 'green', 'red'])\n",
" \n",
"plt.xlabel('Day')\n",
"plt.ylabel('Attendance')\n",
"plt.title('Attendance - Day')\n",
"\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Mediana"
]
},
{
"cell_type": "code",
2022-10-18 17:35:27 +02:00
"execution_count": 14,
2022-10-18 00:24:12 +02:00
"metadata": {},
"outputs": [
{
2022-10-18 17:35:27 +02:00
"output_type": "display_data",
2022-10-18 00:24:12 +02:00
"data": {
2022-10-18 17:35:27 +02:00
"text/plain": "<Figure size 432x288 with 1 Axes>",
"image/svg+xml": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<svg xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"401.690625pt\" height=\"277.314375pt\" viewBox=\"0 0 401.690625 277.314375\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">\n <metadata>\n <rdf:RDF xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n <cc:Work>\n <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n <dc:date>2022-10-18T17:29:59.215279</dc:date>\n <dc:format>image/svg+xml</dc:format>\n <dc:creator>\n <cc:Agent>\n <dc:title>Matplotlib v3.5.1, https://matplotlib.org/</dc:title>\n </cc:Agent>\n </dc:creator>\n </cc:Work>\n </rdf:RDF>\n </metadata>\n <defs>\n <style type=\"text/css\">*{stroke-linejoin: round; stroke-linecap: butt}</style>\n </defs>\n <g id=\"figure_1\">\n <g id=\"patch_1\">\n <path d=\"M 0 277.314375 \nL 401.690625 277.314375 \nL 401.690625 0 \nL 0 0 \nL 0 277.314375 \nz\n\" style=\"fill: none\"/>\n </g>\n <g id=\"axes_1\">\n <g id=\"patch_2\">\n <path d=\"M 59.690625 239.758125 \nL 394.490625 239.758125 \nL 394.490625 22.318125 \nL 59.690625 22.318125 \nz\n\" style=\"fill: #ffffff\"/>\n </g>\n <g id=\"patch_3\">\n <path d=\"M 74.908807 239.758125 \nL 110.716293 239.758125 \nL 110.716293 81.282453 \nL 74.908807 81.282453 \nz\n\" clip-path=\"url(#p785bd4943c)\" style=\"fill: #0000ff\"/>\n </g>\n <g id=\"patch_4\">\n <path d=\"M 119.668165 239.758125 \nL 155.475652 239.758125 \nL 155.475652 88.096074 \nL 119.668165 88.096074 \nz\n\" clip-path=\"url(#p785bd4943c)\" style=\"fill: #008000\"/>\n </g>\n <g id=\"patch_5\">\n <path d=\"M 164.427523 239.758125 \nL 200.23501 239.758125 \nL 200.23501 84.982025 \nL 164.427523 84.982025 \nz\n\" clip-path=\"url(#p785bd4943c)\" style=\"fill: #ff0000\"/>\n </g>\n <g id=\"patch_6\">\n <path d=\"M 209.186882 239.758125 \nL 244.994368 239.758125 \nL 244.994368 83.269152 \nL 209.186882 83.269152 \nz\n\" clip-path=\"url(#p785bd4943c)\" style=\"fill: #0000ff\"/>\n </g>\n <g id=\"patch_7\">\n <path d=\"M 253.94624 239.758125 \nL 289.753727 239.758125 \nL 289.753727 56.664279 \nL 253.94624 56.664279 \nz\n\" clip-path=\"url(#p785bd4943c)\" style=\"fill: #008000\"/>\n </g>\n <g id=\"patch_8\">\n <path d=\"M 298.705598 239.758125 \nL 334.513085 239.758125 \nL 334.513085 32.672411 \nL 298.705598 32.672411 \nz\n\" clip-path=\"url(#p785bd4943c)\" style=\"fill: #ff0000\"/>\n </g>\n <g id=\"patch_9\">\n <path d=\"M 343.464957 239.758125 \nL 379.272443 239.758125 \nL 379.272443 48.673787 \nL 343.464957 48.673787 \nz\n\" clip-path=\"url(#p785bd4943c)\" style=\"fill: #0000ff\"/>\n </g>\n <g id=\"matplotlib.axis_1\">\n <g id=\"xtick_1\">\n <g id=\"line2d_1\">\n <defs>\n <path id=\"md65989fc3e\" d=\"M 0 0 \nL 0 3.5 \n\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n </defs>\n <g>\n <use xlink:href=\"#md65989fc3e\" x=\"92.81255\" y=\"239.758125\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n </g>\n </g>\n <g id=\"text_1\">\n <!-- monday -->\n <g transform=\"translate(72.516456 254.356562)scale(0.1 -0.1)\">\n <defs>\n <path id=\"DejaVuSans-6d\" d=\"M 3328 2828 \nQ 3544 3216 3844 3400 \nQ 4144 3584 4550 3584 \nQ 5097 3584 5394 3201 \nQ 5691 2819 5691 2113 \nL 5691 0 \nL 5113 0 \nL 5113 2094 \nQ 5113 2597 4934 2840 \nQ 4756 3084 4391 3084 \nQ 3944 3084 3684 2787 \nQ 3425 2491 3425 1978 \nL 3425 0 \nL 2847 0 \nL 2847 2094 \nQ 2847 2600 2669 2842 \nQ 2491 3084 2119 3084 \nQ 1678 3084 1418 2786 \nQ 1159 2488 1159 1978 \nL 1159 0 \nL 581 0 \nL 581 3500 \nL 1159 3500 \nL 1159 2956 \nQ 1356 3278 1631 3431 \nQ 1906 3584 2284 3584 \nQ 2666 3584 2933 3390 \nQ 3200 3197 3328 2828 \nz\n\" transform=\"scale(0.015625)\"/>\n <path id=\"DejaVuSans-6f\" d=\"M 1959 3097 \nQ 1497 3097 1228 2736 \nQ 959 2375 95
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAZEAAAEWCAYAAACnlKo3AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAiwklEQVR4nO3de7xVdbnv8c9XRCRvoK7cBipmlNtLkq6tWLYjNQWrA7ujbs2SyFfkUbfdt9qu8JKV3WyjZQeTACPRraVsxYhD3soQULmK5go1IBSUm0pewOf88fut3XC51mIyWHOuNV3f9+s1XmuMZ9yeMRjMZ/7GbSoiMDMzK2O7zk7AzMzql4uImZmV5iJiZmaluYiYmVlpLiJmZlaai4iZmZXmImLWgSQNkBSStu/sXMxqwUXE3hQk3S1praReLeJPSjq+MOwP+RYkTZD0iqTnc7dI0rcl7dbZuVnX5yJidU/SAOD9QAD/q3OzqVvfjYhdgAZgFDAY+IOknTo3LevqXETszeBMYBYwARjZHJR0PbAv8N+SXpD078C9efS6HDs6T/tpSUtya2a6pP0KywlJZ0t6X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nxojjVJurAQ31/SAzl+o6QdqrU9Zmb2RtVsiWwCvhQRBwGDgXMlHZTHXRkRg3I3DSCPOw04GBgK/ERSD0k9gB8Dw4CDgNMLy7kiL+sdwFrgrCpuj5mZtVC1IhIRKyPiodz/PLAE6NfOLMOBKRHxckQ8ATQBR+auKSKWRsQrwBRguCQBxwI35/knAiOqsjFmZtaqmlwTkTQAeA/wQA6dJ2mBpPGS+uZYP2BZYbblOdZWfA9gXURsahFvbf2jJc2
2022-10-18 00:24:12 +02:00
},
"metadata": {
"needs_background": "light"
2022-10-18 17:35:27 +02:00
}
2022-10-18 00:24:12 +02:00
}
],
"source": [
"import matplotlib.pyplot as plt\n",
" \n",
"left = [1, 2, 3, 4, 5, 6, 7]\n",
"\n",
"height = [monday['attendance'].median(), tuesday['attendance'].median(), wednesday['attendance'].median(), \n",
"thursday['attendance'].median(), friday['attendance'].median(), saturday['attendance'].median(), sunday['attendance'].median()]\n",
"\n",
"tick_label = ['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday']\n",
"\n",
"plt.bar(left, height, tick_label = tick_label,\n",
" width = 0.8, color = ['blue', 'green', 'red'])\n",
" \n",
"plt.xlabel('Day')\n",
"plt.ylabel('Attendance')\n",
"plt.title('Attendance - Day')\n",
"\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Najwięcej kibiców jest w weekendy."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Zwycięstwo / porażka gospodarzy\n",
"![image3](win.jpg)"
]
},
{
"cell_type": "code",
2022-10-18 17:35:27 +02:00
"execution_count": 15,
2022-10-18 00:24:12 +02:00
"metadata": {},
"outputs": [
{
2022-10-18 17:35:27 +02:00
"output_type": "execute_result",
2022-10-18 00:24:12 +02:00
"data": {
"text/plain": [
"array(['Win', 'Loss'], dtype=object)"
]
},
"metadata": {},
2022-10-18 17:35:27 +02:00
"execution_count": 15
2022-10-18 00:24:12 +02:00
}
],
"source": [
"data['home_team_outcome'].unique()"
]
},
{
"cell_type": "code",
2022-10-18 17:35:27 +02:00
"execution_count": 16,
2022-10-18 00:24:12 +02:00
"metadata": {},
"outputs": [],
"source": [
"win = data[data['home_team_outcome'] == 'Win']\n",
"loss = data[data['home_team_outcome'] == 'Loss']"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Średnia ilość kibiców przy wygraniu/przegraniu gospodarzy"
]
},
{
"cell_type": "code",
2022-10-18 17:35:27 +02:00
"execution_count": 18,
2022-10-18 00:24:12 +02:00
"metadata": {},
"outputs": [
{
2022-10-18 17:35:27 +02:00
"output_type": "display_data",
2022-10-18 00:24:12 +02:00
"data": {
2022-10-18 17:35:27 +02:00
"text/plain": "<Figure size 432x288 with 1 Axes>",
"image/svg+xml": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<svg xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"401.690625pt\" height=\"277.314375pt\" viewBox=\"0 0 401.690625 277.314375\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">\n <metadata>\n <rdf:RDF xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n <cc:Work>\n <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n <dc:date>2022-10-18T17:30:04.616815</dc:date>\n <dc:format>image/svg+xml</dc:format>\n <dc:creator>\n <cc:Agent>\n <dc:title>Matplotlib v3.5.1, https://matplotlib.org/</dc:title>\n </cc:Agent>\n </dc:creator>\n </cc:Work>\n </rdf:RDF>\n </metadata>\n <defs>\n <style type=\"text/css\">*{stroke-linejoin: round; stroke-linecap: butt}</style>\n </defs>\n <g id=\"figure_1\">\n <g id=\"patch_1\">\n <path d=\"M 0 277.314375 \nL 401.690625 277.314375 \nL 401.690625 0 \nL 0 0 \nL 0 277.314375 \nz\n\" style=\"fill: none\"/>\n </g>\n <g id=\"axes_1\">\n <g id=\"patch_2\">\n <path d=\"M 59.690625 239.758125 \nL 394.490625 239.758125 \nL 394.490625 22.318125 \nL 59.690625 22.318125 \nz\n\" style=\"fill: #ffffff\"/>\n </g>\n <g id=\"patch_3\">\n <path d=\"M 74.908807 239.758125 \nL 210.181534 239.758125 \nL 210.181534 32.672411 \nL 74.908807 32.672411 \nz\n\" clip-path=\"url(#p1efa5314e8)\" style=\"fill: #0000ff\"/>\n </g>\n <g id=\"patch_4\">\n <path d=\"M 243.999716 239.758125 \nL 379.272443 239.758125 \nL 379.272443 38.742064 \nL 243.999716 38.742064 \nz\n\" clip-path=\"url(#p1efa5314e8)\" style=\"fill: #ff0000\"/>\n </g>\n <g id=\"matplotlib.axis_1\">\n <g id=\"xtick_1\">\n <g id=\"line2d_1\">\n <defs>\n <path id=\"m7bb776ba1d\" d=\"M 0 0 \nL 0 3.5 \n\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n </defs>\n <g>\n <use xlink:href=\"#m7bb776ba1d\" x=\"142.54517\" y=\"239.758125\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n </g>\n </g>\n <g id=\"text_1\">\n <!-- win -->\n <g transform=\"translate(133.898295 254.356562)scale(0.1 -0.1)\">\n <defs>\n <path id=\"DejaVuSans-77\" d=\"M 269 3500 \nL 844 3500 \nL 1563 769 \nL 2278 3500 \nL 2956 3500 \nL 3675 769 \nL 4391 3500 \nL 4966 3500 \nL 4050 0 \nL 3372 0 \nL 2619 2869 \nL 1863 0 \nL 1184 0 \nL 269 3500 \nz\n\" transform=\"scale(0.015625)\"/>\n <path id=\"DejaVuSans-69\" d=\"M 603 3500 \nL 1178 3500 \nL 1178 0 \nL 603 0 \nL 603 3500 \nz\nM 603 4863 \nL 1178 4863 \nL 1178 4134 \nL 603 4134 \nL 603 4863 \nz\n\" transform=\"scale(0.015625)\"/>\n <path id=\"DejaVuSans-6e\" d=\"M 3513 2113 \nL 3513 0 \nL 2938 0 \nL 2938 2094 \nQ 2938 2591 2744 2837 \nQ 2550 3084 2163 3084 \nQ 1697 3084 1428 2787 \nQ 1159 2491 1159 1978 \nL 1159 0 \nL 581 0 \nL 581 3500 \nL 1159 3500 \nL 1159 2956 \nQ 1366 3272 1645 3428 \nQ 1925 3584 2291 3584 \nQ 2894 3584 3203 3211 \nQ 3513 2838 3513 2113 \nz\n\" transform=\"scale(0.015625)\"/>\n </defs>\n <use xlink:href=\"#DejaVuSans-77\"/>\n <use xlink:href=\"#DejaVuSans-69\" x=\"81.787109\"/>\n <use xlink:href=\"#DejaVuSans-6e\" x=\"109.570312\"/>\n </g>\n </g>\n </g>\n <g id=\"xtick_2\">\n <g id=\"line2d_2\">\n <g>\n <use xlink:href=\"#m7bb776ba1d\" x=\"311.63608\" y=\"239.758125\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n </g>\n </g>\n <g id=\"text_2\">\n <!-- loss -->\n <g transform=\"translate(301.978267 254.356562)scale(0.1 -0.1)\">\n <defs>\n <path id=\"DejaVuSans-6c\" d=\"M 603 4863 \nL 1178 4863 \nL 1178 0 \nL 603 0 \nL 603 4863 \nz\n\" transform=\"scale(0.015625)\"/>\n <path id=\"DejaVuSans-6f\" d=\"M 1959 3097 \nQ 1497 3097 1228 2736 \nQ 959 2375 959 1747 \nQ 959 1119 1226 758 \nQ 1494 397 1959 397 \nQ 2419 397 2687 759 \nQ 2956 1122 2956 1747 \nQ 2956 2369 2687 2733 \nQ 2419
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAZEAAAEWCAYAAACnlKo3AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAaKklEQVR4nO3dfbRddX3n8feHIEiLFpTI0IAG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oICvA78MUFW3JrkYuI1uZNc7q+opgCTvAlYBi4Bzq+rWtr/fAS5K8gfAl+hCS5I0Jun+Q79wTExM1OTkZK9tk+3cGO00dpg/Iz+kmsk2fkiTrKmqiel171iXJPVmiEiSejNEJEm9GSKSpN4MEUlSb4aIJKk3Q0SS1JshIknqzRCRJPVmiEiSejNEJEm9GSKSpN4MEUlSb4aIJKk3Q0SS1JshIknqzRCRJPVmiEiSejNEJEm9GSKSpN4MEUlSb4aIJKk3Q0SS1JshIknqbWQhkuSAJFckuS3JrUne3erPS7I6ye3t596tniRnJFmX5KYkhw7sa0Vb//YkKwbqr0xyc9vmjCQZ1fFIkp5ulGciTwK/UVUHA4cD70xyMHAqcHlVLQMub/MAxwDL2usU4CzoQgc4HXgVcBhw+lTwtHV+aWC75SM8HknSNCMLkaq6q6r+uU0/DKwFlgDHAee31c4Hjm/TxwEXVOdaYK8k+wFHA6uranNV3Q+sBpa3Zc+tqmurqoALBvYlSRqDsVwTSbIU+EHgOmDfqrqrLfoGsG+bXgKsH9hsQ6vNVt+whfqW3v+UJJNJJjdt2rRtByNJ+g/PGCJJvifJ5UluafM/kOQ9w75Bkj2BTwO/WlUPDS5rZxC1lW3ealV1dlVNVNXE4sWLR/12krRgDHM
2022-10-18 00:24:12 +02:00
},
"metadata": {
"needs_background": "light"
2022-10-18 17:35:27 +02:00
}
2022-10-18 00:24:12 +02:00
}
],
"source": [
"left = [1, 2]\n",
"\n",
"height = [win['attendance'].mean(), loss['attendance'].mean()]\n",
"\n",
"tick_label = ['win', 'loss']\n",
"\n",
"plt.bar(left, height, tick_label = tick_label,\n",
" width = 0.8, color = ['blue', 'red'])\n",
" \n",
"plt.xlabel('Win')\n",
"plt.ylabel('Attendance')\n",
"plt.title('Attendance - Win')\n",
"\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Mediana"
]
},
{
"cell_type": "code",
2022-10-18 17:35:27 +02:00
"execution_count": 19,
2022-10-18 00:24:12 +02:00
"metadata": {},
"outputs": [
{
2022-10-18 17:35:27 +02:00
"output_type": "display_data",
2022-10-18 00:24:12 +02:00
"data": {
2022-10-18 17:35:27 +02:00
"text/plain": "<Figure size 432x288 with 1 Axes>",
"image/svg+xml": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<svg xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"401.690625pt\" height=\"277.314375pt\" viewBox=\"0 0 401.690625 277.314375\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">\n <metadata>\n <rdf:RDF xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n <cc:Work>\n <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n <dc:date>2022-10-18T17:30:08.085830</dc:date>\n <dc:format>image/svg+xml</dc:format>\n <dc:creator>\n <cc:Agent>\n <dc:title>Matplotlib v3.5.1, https://matplotlib.org/</dc:title>\n </cc:Agent>\n </dc:creator>\n </cc:Work>\n </rdf:RDF>\n </metadata>\n <defs>\n <style type=\"text/css\">*{stroke-linejoin: round; stroke-linecap: butt}</style>\n </defs>\n <g id=\"figure_1\">\n <g id=\"patch_1\">\n <path d=\"M 0 277.314375 \nL 401.690625 277.314375 \nL 401.690625 0 \nL 0 0 \nL 0 277.314375 \nz\n\" style=\"fill: none\"/>\n </g>\n <g id=\"axes_1\">\n <g id=\"patch_2\">\n <path d=\"M 59.690625 239.758125 \nL 394.490625 239.758125 \nL 394.490625 22.318125 \nL 59.690625 22.318125 \nz\n\" style=\"fill: #ffffff\"/>\n </g>\n <g id=\"patch_3\">\n <path d=\"M 74.908807 239.758125 \nL 210.181534 239.758125 \nL 210.181534 32.672411 \nL 74.908807 32.672411 \nz\n\" clip-path=\"url(#p5d19f83a61)\" style=\"fill: #0000ff\"/>\n </g>\n <g id=\"patch_4\">\n <path d=\"M 243.999716 239.758125 \nL 379.272443 239.758125 \nL 379.272443 42.091434 \nL 243.999716 42.091434 \nz\n\" clip-path=\"url(#p5d19f83a61)\" style=\"fill: #ff0000\"/>\n </g>\n <g id=\"matplotlib.axis_1\">\n <g id=\"xtick_1\">\n <g id=\"line2d_1\">\n <defs>\n <path id=\"mbe25eff57e\" d=\"M 0 0 \nL 0 3.5 \n\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n </defs>\n <g>\n <use xlink:href=\"#mbe25eff57e\" x=\"142.54517\" y=\"239.758125\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n </g>\n </g>\n <g id=\"text_1\">\n <!-- win -->\n <g transform=\"translate(133.898295 254.356562)scale(0.1 -0.1)\">\n <defs>\n <path id=\"DejaVuSans-77\" d=\"M 269 3500 \nL 844 3500 \nL 1563 769 \nL 2278 3500 \nL 2956 3500 \nL 3675 769 \nL 4391 3500 \nL 4966 3500 \nL 4050 0 \nL 3372 0 \nL 2619 2869 \nL 1863 0 \nL 1184 0 \nL 269 3500 \nz\n\" transform=\"scale(0.015625)\"/>\n <path id=\"DejaVuSans-69\" d=\"M 603 3500 \nL 1178 3500 \nL 1178 0 \nL 603 0 \nL 603 3500 \nz\nM 603 4863 \nL 1178 4863 \nL 1178 4134 \nL 603 4134 \nL 603 4863 \nz\n\" transform=\"scale(0.015625)\"/>\n <path id=\"DejaVuSans-6e\" d=\"M 3513 2113 \nL 3513 0 \nL 2938 0 \nL 2938 2094 \nQ 2938 2591 2744 2837 \nQ 2550 3084 2163 3084 \nQ 1697 3084 1428 2787 \nQ 1159 2491 1159 1978 \nL 1159 0 \nL 581 0 \nL 581 3500 \nL 1159 3500 \nL 1159 2956 \nQ 1366 3272 1645 3428 \nQ 1925 3584 2291 3584 \nQ 2894 3584 3203 3211 \nQ 3513 2838 3513 2113 \nz\n\" transform=\"scale(0.015625)\"/>\n </defs>\n <use xlink:href=\"#DejaVuSans-77\"/>\n <use xlink:href=\"#DejaVuSans-69\" x=\"81.787109\"/>\n <use xlink:href=\"#DejaVuSans-6e\" x=\"109.570312\"/>\n </g>\n </g>\n </g>\n <g id=\"xtick_2\">\n <g id=\"line2d_2\">\n <g>\n <use xlink:href=\"#mbe25eff57e\" x=\"311.63608\" y=\"239.758125\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n </g>\n </g>\n <g id=\"text_2\">\n <!-- loss -->\n <g transform=\"translate(301.978267 254.356562)scale(0.1 -0.1)\">\n <defs>\n <path id=\"DejaVuSans-6c\" d=\"M 603 4863 \nL 1178 4863 \nL 1178 0 \nL 603 0 \nL 603 4863 \nz\n\" transform=\"scale(0.015625)\"/>\n <path id=\"DejaVuSans-6f\" d=\"M 1959 3097 \nQ 1497 3097 1228 2736 \nQ 959 2375 959 1747 \nQ 959 1119 1226 758 \nQ 1494 397 1959 397 \nQ 2419 397 2687 759 \nQ 2956 1122 2956 1747 \nQ 2956 2369 2687 2733 \nQ 2419
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAZEAAAEWCAYAAACnlKo3AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAaMklEQVR4nO3dfZQldX3n8feHQZCEGDCMLBnAITLRgA8EOwhEXZ8CA4mBZI3BZMMsYUNccaNZ8wBZdzEaE01WzZKgWYgIuCTI0SizSjLOIQhERGgiz+hhguLMBGFwhqew4cnv/lG/1rtNd3Op4d6enn6/zrmnq771q7q/6nOnP1NVv7qVqkKSpD52mO8OSJIWLkNEktSbISJJ6s0QkST1ZohIknozRCRJvRki0tMoyfIklWTH+e7LqCR5MMmPzHc/tG0wRLRdSPKFJFuS7Dyt/o0krxuY3+7/yD8VSQ5L8kCSJQO1s2ap/QVAVe1aVbfPR3+17T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m5O8rdWfnWRtktvaz91bPUlOT7IuyQ1JDh7Y1qrW/rYkqwbqL01yY1vn9CQZ1f5Ikp5olEcijwHvqKoDgEOBk5McAJwCXFJVK4BL2jzAUcCK9joJ+Ah0oQOcBrwMOAQ4bSp4WptfG1hv5Qj3R5I0zZOGSJIfTXJJkpva/IuTvPPJ1quqO6vqH9v0A8CtwDLgGODc1uxc4Ng2fQxwXnWuAnZLshdwJLC2qjZX1RZgLbCyLXtWVV1VVQWcN7AtSdIYDHMkchZwKvAoQFXdABz3VN4kyXLgx4EvA3tW1Z1t0beAPdv0MmD9wGobWm2u+oYZ6jO9/0lJJpNMbtq06al0XZI0h2FC5Puq6upptce
2022-10-18 00:24:12 +02:00
},
"metadata": {
"needs_background": "light"
2022-10-18 17:35:27 +02:00
}
2022-10-18 00:24:12 +02:00
}
],
"source": [
"left = [1, 2]\n",
"\n",
"height = [win['attendance'].median(), loss['attendance'].median()]\n",
"\n",
"tick_label = ['win', 'loss']\n",
"\n",
"plt.bar(left, height, tick_label = tick_label,\n",
" width = 0.8, color = ['blue', 'red'])\n",
" \n",
"plt.xlabel('Win')\n",
"plt.ylabel('Attendance')\n",
"plt.title('Attendance - Win')\n",
"\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Nie ma to wpływu, raczej nie jest tak, że widać przegraną przed końcem i przez to kibice wychodzą. A nawet jeśli to działa to w miarę równomiernie w obie strony."
]
2022-10-18 00:53:52 +02:00
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Zwycięstwa w kolejnych meczach\n",
"\n",
"![image4](win-streak.png)"
]
},
{
"cell_type": "code",
2022-10-18 17:35:27 +02:00
"execution_count": 20,
2022-10-18 00:53:52 +02:00
"metadata": {},
"outputs": [
{
2022-10-18 17:35:27 +02:00
"output_type": "execute_result",
2022-10-18 00:53:52 +02:00
"data": {
"text/plain": [
"array(['New York Mets', 'Philadelphia Phillies', 'Minnesota Twins',\n",
" 'Washington Nationals', 'Colorado Rockies', 'Seattle Mariners',\n",
" 'Toronto Blue Jays', 'Los Angeles Dodgers', 'St. Louis Cardinals',\n",
" 'Chicago White Sox', 'Houston Astros', 'San Francisco Giants',\n",
" 'Detroit Tigers', 'Texas Rangers', 'San Diego Padres',\n",
" 'Los Angeles Angels of Anaheim', 'Miami Marlins',\n",
" 'Kansas City Royals', 'Pittsburgh Pirates', 'Cincinnati Reds',\n",
" 'Atlanta Braves', 'New York Yankees', 'Chicago Cubs',\n",
" 'Arizona Diamondbacks', 'Milwaukee Brewers', 'Baltimore Orioles',\n",
" 'Cleveland Indians', 'Oakland Athletics', 'Boston Red Sox',\n",
" 'Tampa Bay Rays'], dtype=object)"
]
},
"metadata": {},
2022-10-18 17:35:27 +02:00
"execution_count": 20
2022-10-18 00:53:52 +02:00
}
],
"source": [
"data['away_team'].unique()"
]
},
{
"cell_type": "code",
2022-10-18 17:35:27 +02:00
"execution_count": 26,
2022-10-18 00:53:52 +02:00
"metadata": {},
"outputs": [],
"source": [
"mets = data[data['away_team'] == 'New York Mets']"
]
},
{
"cell_type": "code",
2022-10-18 17:35:27 +02:00
"execution_count": 27,
2022-10-18 00:53:52 +02:00
"metadata": {},
"outputs": [
{
2022-10-18 17:35:27 +02:00
"output_type": "execute_result",
2022-10-18 00:53:52 +02:00
"data": {
"text/plain": [
"Text(0.5, 1.0, 'Attendance - Win/Lose')"
]
},
"metadata": {},
2022-10-18 17:35:27 +02:00
"execution_count": 27
2022-10-18 00:53:52 +02:00
},
{
2022-10-18 17:35:27 +02:00
"output_type": "display_data",
2022-10-18 00:53:52 +02:00
"data": {
2022-10-18 17:35:27 +02:00
"text/plain": "<Figure size 1728x216 with 1 Axes>",
"image/svg+xml": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<svg xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"1406.090625pt\" height=\"222.954375pt\" viewBox=\"0 0 1406.090625 222.954375\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">\n <metadata>\n <rdf:RDF xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n <cc:Work>\n <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n <dc:date>2022-10-18T17:31:05.283000</dc:date>\n <dc:format>image/svg+xml</dc:format>\n <dc:creator>\n <cc:Agent>\n <dc:title>Matplotlib v3.5.1, https://matplotlib.org/</dc:title>\n </cc:Agent>\n </dc:creator>\n </cc:Work>\n </rdf:RDF>\n </metadata>\n <defs>\n <style type=\"text/css\">*{stroke-linejoin: round; stroke-linecap: butt}</style>\n </defs>\n <g id=\"figure_1\">\n <g id=\"patch_1\">\n <path d=\"M 0 222.954375 \nL 1406.090625 222.954375 \nL 1406.090625 0 \nL 0 0 \nL 0 222.954375 \nz\n\" style=\"fill: none\"/>\n </g>\n <g id=\"axes_1\">\n <g id=\"patch_2\">\n <path d=\"M 59.690625 185.398125 \nL 1398.890625 185.398125 \nL 1398.890625 22.318125 \nL 59.690625 22.318125 \nz\n\" style=\"fill: #ffffff\"/>\n </g>\n <g id=\"patch_3\">\n <path d=\"M 120.563352 185.398125 \nL 128.125182 185.398125 \nL 128.125182 56.780842 \nL 120.563352 56.780842 \nz\n\" clip-path=\"url(#pe75d99b9d4)\" style=\"fill: #ff0000\"/>\n </g>\n <g id=\"patch_4\">\n <path d=\"M 135.687011 185.398125 \nL 143.248841 185.398125 \nL 143.248841 116.045038 \nL 135.687011 116.045038 \nz\n\" clip-path=\"url(#pe75d99b9d4)\" style=\"fill: #0000ff\"/>\n </g>\n <g id=\"patch_5\">\n <path d=\"M 150.81067 185.398125 \nL 158.3725 185.398125 \nL 158.3725 53.574245 \nL 150.81067 53.574245 \nz\n\" clip-path=\"url(#pe75d99b9d4)\" style=\"fill: #0000ff\"/>\n </g>\n <g id=\"patch_6\">\n <path d=\"M 165.934329 185.398125 \nL 173.496159 185.398125 \nL 173.496159 61.015605 \nL 165.934329 61.015605 \nz\n\" clip-path=\"url(#pe75d99b9d4)\" style=\"fill: #ff0000\"/>\n </g>\n <g id=\"patch_7\">\n <path d=\"M 181.057988 185.398125 \nL 188.619818 185.398125 \nL 188.619818 61.054161 \nL 181.057988 61.054161 \nz\n\" clip-path=\"url(#pe75d99b9d4)\" style=\"fill: #0000ff\"/>\n </g>\n <g id=\"patch_8\">\n <path d=\"M 196.181647 185.398125 \nL 203.743476 185.398125 \nL 203.743476 111.562872 \nL 196.181647 111.562872 \nz\n\" clip-path=\"url(#pe75d99b9d4)\" style=\"fill: #0000ff\"/>\n </g>\n <g id=\"patch_9\">\n <path d=\"M 211.305306 185.398125 \nL 218.867135 185.398125 \nL 218.867135 65.47528 \nL 211.305306 65.47528 \nz\n\" clip-path=\"url(#pe75d99b9d4)\" style=\"fill: #ff0000\"/>\n </g>\n <g id=\"patch_10\">\n <path d=\"M 226.428965 185.398125 \nL 233.990794 185.398125 \nL 233.990794 53.49392 \nL 226.428965 53.49392 \nz\n\" clip-path=\"url(#pe75d99b9d4)\" style=\"fill: #ff0000\"/>\n </g>\n <g id=\"patch_11\">\n <path d=\"M 241.552624 185.398125 \nL 249.114453 185.398125 \nL 249.114453 52.003078 \nL 241.552624 52.003078 \nz\n\" clip-path=\"url(#pe75d99b9d4)\" style=\"fill: #ff0000\"/>\n </g>\n <g id=\"patch_12\">\n <path d=\"M 256.676283 185.398125 \nL 264.238112 185.398125 \nL 264.238112 31.683924 \nL 256.676283 31.683924 \nz\n\" clip-path=\"url(#pe75d99b9d4)\" style=\"fill: #ff0000\"/>\n </g>\n <g id=\"patch_13\">\n <path d=\"M 271.799942 185.398125 \nL 279.361771 185.398125 \nL 279.361771 119.351238 \nL 271.799942 119.351238 \nz\n\" clip-path=\"url(#pe75d99b9d4)\" style=\"fill: #0000ff\"/>\n </g>\n <g id=\"patch_14\">\n <path d=\"M 286.923601 185.398125 \nL 294.48543 185.398125 \nL 294.48543 66.725146 \nL 286.923601 66.725146 \nz\n\" clip-path=\"url(#pe75d99b9d4)\" style=\"fill: #ff0000\"/>\n </g>\n <g id=\"patch_15\">\n <path d=\"M 302.04726 185.398125 \nL 309.609089 185.398125 \nL 309.609089 120.414749 \nL 302.04726 12
"image/png": "iVBORw0KGgoAAAANSUhEUgAABX0AAADgCAYAAABfL8X6AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAkwklEQVR4nO3de7QtdXUn+u8UBEzQgOFIExDRiFHMNUZPFA3YPhJeUfFmGBvbCI0M6YyYjnZiEuiRbtsYE3V0NLFb0xeVCF5tZCQ+uBFDaB+AIsJBIgrEywmKQFBAQEAj8pj9x6ojy+M5+3H2WXudtfbnM0aNXTWrflWzqtZae++5f/tX1d0BAAAAAGA+PGjaCQAAAAAAsP0o+gIAAAAAzBFFXwAAAACAOaLoCwAAAAAwRxR9AQAAAADmiKIvAAAAAMAcUfQFAAAAAJgjir4AAMytqjqgqrqqdp52LpNSVXdV1WOmnQcAADsORV8AALa7qvp0Vd1WVbtuFv9aVf3S2PLcF2WXo6qeUVV3VtVOY7F3bSX2P5Oku3fv7muWeYwLh/muqsduz3MAAGD6FH0BANiuquqAJIcm6SQvnG42M2dDRj+jP2UsdmiS6zeLPSvJ+dt4jF9JcvY2tgUAYAYo+gIAsL0dm+SiJO9NctymYFW9L8n+Sf6/YUiC388Dhcvbh9gzhm1fUVVXDb2Fz6mqR43tp6vqN6rq6qq6vareUVU1rNupqv5bVd1SVddkVODMWNvjh/3eWVXXVNW/H1v37Kq6vqp+t6puqqobq+r4sfUPqao/q6prq+rbVfWZqnrIsO7gqrpwyOeLVfXsbblw3X3PcO2eNez3EUl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bez
2022-10-18 00:53:52 +02:00
},
"metadata": {
"needs_background": "light"
2022-10-18 17:35:27 +02:00
}
2022-10-18 00:53:52 +02:00
}
],
"source": [
"left = [i for i in range(len(mets))]\n",
"\n",
"height = [i for i in mets['attendance']]\n",
"\n",
"tick_label = ['l' if [i for i in mets['home_team_outcome']][i] == 'Win' else 'w' for i in range(len(mets))]\n",
"\n",
"plt.figure(figsize=(24, 3)) # width:20, height:3\n",
"plt.bar(left, height, tick_label = tick_label,\n",
2022-10-18 17:35:27 +02:00
" width = 0.5, color = ['red' if [i for i in mets['home_team_outcome']][i] == 'Win' else 'blue' for i in range(len(mets))])\n",
2022-10-18 00:53:52 +02:00
" \n",
"plt.xlabel('Win (w) or Lose (l)')\n",
"plt.ylabel('Attendance')\n",
"plt.title('Attendance - Win/Lose')"
]
},
{
"cell_type": "code",
2022-10-18 17:35:27 +02:00
"execution_count": 28,
2022-10-18 00:53:52 +02:00
"metadata": {},
"outputs": [],
"source": [
"philadelphia = data[data['away_team'] == 'Philadelphia Phillies']"
]
},
{
"cell_type": "code",
2022-10-18 17:35:27 +02:00
"execution_count": 29,
2022-10-18 00:53:52 +02:00
"metadata": {},
"outputs": [
{
2022-10-18 17:35:27 +02:00
"output_type": "execute_result",
2022-10-18 00:53:52 +02:00
"data": {
"text/plain": [
"Text(0.5, 1.0, 'Attendance - Win/Lose')"
]
},
"metadata": {},
2022-10-18 17:35:27 +02:00
"execution_count": 29
2022-10-18 00:53:52 +02:00
},
{
2022-10-18 17:35:27 +02:00
"output_type": "display_data",
2022-10-18 00:53:52 +02:00
"data": {
2022-10-18 17:35:27 +02:00
"text/plain": "<Figure size 1728x216 with 1 Axes>",
"image/svg+xml": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<svg xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"1406.090625pt\" height=\"222.954375pt\" viewBox=\"0 0 1406.090625 222.954375\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">\n <metadata>\n <rdf:RDF xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n <cc:Work>\n <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n <dc:date>2022-10-18T17:32:31.897068</dc:date>\n <dc:format>image/svg+xml</dc:format>\n <dc:creator>\n <cc:Agent>\n <dc:title>Matplotlib v3.5.1, https://matplotlib.org/</dc:title>\n </cc:Agent>\n </dc:creator>\n </cc:Work>\n </rdf:RDF>\n </metadata>\n <defs>\n <style type=\"text/css\">*{stroke-linejoin: round; stroke-linecap: butt}</style>\n </defs>\n <g id=\"figure_1\">\n <g id=\"patch_1\">\n <path d=\"M 0 222.954375 \nL 1406.090625 222.954375 \nL 1406.090625 0 \nL 0 0 \nL 0 222.954375 \nz\n\" style=\"fill: none\"/>\n </g>\n <g id=\"axes_1\">\n <g id=\"patch_2\">\n <path d=\"M 59.690625 185.398125 \nL 1398.890625 185.398125 \nL 1398.890625 22.318125 \nL 59.690625 22.318125 \nz\n\" style=\"fill: #ffffff\"/>\n </g>\n <g id=\"patch_3\">\n <path d=\"M 120.563352 185.398125 \nL 128.125182 185.398125 \nL 128.125182 115.973892 \nL 120.563352 115.973892 \nz\n\" clip-path=\"url(#p726151d745)\" style=\"fill: #ff0000\"/>\n </g>\n <g id=\"patch_4\">\n <path d=\"M 135.687011 185.398125 \nL 143.248841 185.398125 \nL 143.248841 56.680247 \nL 135.687011 56.680247 \nz\n\" clip-path=\"url(#p726151d745)\" style=\"fill: #0000ff\"/>\n </g>\n <g id=\"patch_5\">\n <path d=\"M 150.81067 185.398125 \nL 158.3725 185.398125 \nL 158.3725 115.659217 \nL 150.81067 115.659217 \nz\n\" clip-path=\"url(#p726151d745)\" style=\"fill: #0000ff\"/>\n </g>\n <g id=\"patch_6\">\n <path d=\"M 165.934329 185.398125 \nL 173.496159 185.398125 \nL 173.496159 105.021296 \nL 165.934329 105.021296 \nz\n\" clip-path=\"url(#p726151d745)\" style=\"fill: #ff0000\"/>\n </g>\n <g id=\"patch_7\">\n <path d=\"M 181.057988 185.398125 \nL 188.619818 185.398125 \nL 188.619818 125.664578 \nL 181.057988 125.664578 \nz\n\" clip-path=\"url(#p726151d745)\" style=\"fill: #0000ff\"/>\n </g>\n <g id=\"patch_8\">\n <path d=\"M 196.181647 185.398125 \nL 203.743476 185.398125 \nL 203.743476 70.439224 \nL 196.181647 70.439224 \nz\n\" clip-path=\"url(#p726151d745)\" style=\"fill: #ff0000\"/>\n </g>\n <g id=\"patch_9\">\n <path d=\"M 211.305306 185.398125 \nL 218.867135 185.398125 \nL 218.867135 62.623739 \nL 211.305306 62.623739 \nz\n\" clip-path=\"url(#p726151d745)\" style=\"fill: #0000ff\"/>\n </g>\n <g id=\"patch_10\">\n <path d=\"M 226.428965 185.398125 \nL 233.990794 185.398125 \nL 233.990794 97.029209 \nL 226.428965 97.029209 \nz\n\" clip-path=\"url(#p726151d745)\" style=\"fill: #0000ff\"/>\n </g>\n <g id=\"patch_11\">\n <path d=\"M 241.552624 185.398125 \nL 249.114453 185.398125 \nL 249.114453 93.985216 \nL 241.552624 93.985216 \nz\n\" clip-path=\"url(#p726151d745)\" style=\"fill: #ff0000\"/>\n </g>\n <g id=\"patch_12\">\n <path d=\"M 256.676283 185.398125 \nL 264.238112 185.398125 \nL 264.238112 63.789319 \nL 256.676283 63.789319 \nz\n\" clip-path=\"url(#p726151d745)\" style=\"fill: #ff0000\"/>\n </g>\n <g id=\"patch_13\">\n <path d=\"M 271.799942 185.398125 \nL 279.361771 185.398125 \nL 279.361771 82.258779 \nL 271.799942 82.258779 \nz\n\" clip-path=\"url(#p726151d745)\" style=\"fill: #ff0000\"/>\n </g>\n <g id=\"patch_14\">\n <path d=\"M 286.923601 185.398125 \nL 294.48543 185.398125 \nL 294.48543 114.422996 \nL 286.923601 114.422996 \nz\n\" clip-path=\"url(#p726151d745)\" style=\"fill: #ff0000\"/>\n </g>\n <g id=\"patch_15\">\n <path d=\"M 302.04726 185.398125 \nL 309.609089 185.398125 \nL 309.609089 113.639521 \nL 302.
"image/png": "iVBORw0KGgoAAAANSUhEUgAABX0AAADgCAYAAABfL8X6AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAkxUlEQVR4nO3debRkZXnv8e+PbgEjIiAtQRpEBQf0GiKtgIJxiEwOcLPUi1elgyyJS4waYxSykut1StSVaEKiSVAR8GqQlThwA4pEEVoBoRFFAb20KNIEGWxGB2R47h/1HinaM5+uU2dXfT9r1Tp7P3u/+3127ao61c95+92pKiRJkiRJkiRJo2GzYScgSZIkSZIkSdp0LPpKkiRJkiRJ0gix6CtJkiRJkiRJI8SiryRJkiRJkiSNEIu+kiRJkiRJkjRCLPpKkiRJkiRJ0gix6CtJkiRJkiRJI8SiryRJkkZWkl2TVJLlw85lUJLcmeQxw85DkiRJS4dFX0mSJG1ySb6a5JYkW2wU/1GS3+9bH/mi7Fwk2TfJHUmW9cU+MkXsnwGqaququnqOfZzflivJbpvyHCRJkjR8Fn0lSZK0SSXZFdgfKODFw82mc9bS+47+1L7Y/sD6jWLPAs6bZx8vAM6cZ1tJkiR1gEVfSZIkbWpHABcCJwGrJ4JJPgHsAvzfNiXBW7m/cHlri+3b9n11kivbaOGzkjyq7ziV5LVJrkpya5IPJUnbtizJ3yS5OcnV9Aqc9LU9sh33jiRXJ/mjvm3PTrI+yZ8muTHJ9UmO7Nv+4CR/m+SaJLcl+VqSB7dt+yQ5v+Xz7STPns8TV1V3t+fuWe24jwA2B07bKPa4ieeuf7RukpPa83FGO8dvJHnsRt0cwgxF3yQPS3JKkpva+f5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": {
"needs_background": "light"
2022-10-18 17:35:27 +02:00
}
2022-10-18 00:53:52 +02:00
}
],
"source": [
"left = [i for i in range(len(philadelphia))]\n",
"\n",
"height = [i for i in philadelphia['attendance']]\n",
"\n",
"tick_label = ['l' if [i for i in philadelphia['home_team_outcome']][i] == 'Win' else 'w' for i in range(len(philadelphia))]\n",
"\n",
"plt.figure(figsize=(24, 3)) # width:20, height:3\n",
"plt.bar(left, height, tick_label = tick_label,\n",
2022-10-18 17:35:27 +02:00
" width = 0.5, color = ['red' if [i for i in philadelphia['home_team_outcome']][i] == 'Win' else 'blue' for i in range(len(philadelphia))])\n",
2022-10-18 00:53:52 +02:00
" \n",
"plt.xlabel('Win (w) or Lose (l)')\n",
"plt.ylabel('Attendance')\n",
"plt.title('Attendance - Win/Lose')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Czasami można wywnioskować, że po wygranym meczu przychodzi więcej kibiców na następny, ale nie zawsze, to raczej nie jest częsta zasada."
]
2022-10-18 00:24:12 +02:00
}
],
"metadata": {
"kernelspec": {
2022-10-18 17:35:27 +02:00
"display_name": "Python 3 (ipykernel)",
2022-10-18 00:24:12 +02:00
"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",
2022-10-18 17:35:27 +02:00
"version": "3.8.10-final"
2022-10-18 00:24:12 +02:00
},
"orig_nbformat": 4,
"vscode": {
"interpreter": {
"hash": "3dafdb3de6203a1118d6c063d9a807622a512a5be3d463a10b75ce9c56521739"
}
}
},
"nbformat": 4,
"nbformat_minor": 2
2022-10-18 17:35:27 +02:00
}