Technologische_Grundlagen/course/pandas/.ipynb_checkpoints/03_advanced-checkpoint.ipynb

392 lines
146 KiB
Plaintext
Raw Normal View History

2024-09-27 07:00:19 +00:00
{
"cells": [
{
"cell_type": "markdown",
"id": "ddb0915a-4364-499f-8224-8af96e00cdf2",
"metadata": {},
"source": [
"#### Advanced"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "4f677ea5-7e64-4db2-8d25-c39eec1b1989",
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "38eeb7f7-ba40-41da-a029-35a4b5350878",
"metadata": {},
"outputs": [],
"source": [
"df = pd.read_csv('https://www.w3schools.com/python/pandas/data.csv')"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "ff6a7d3f-d18f-43e8-a03e-257489439289",
"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>Duration</th>\n",
" <th>Pulse</th>\n",
" <th>Maxpulse</th>\n",
" <th>Calories</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>60</td>\n",
" <td>110</td>\n",
" <td>130</td>\n",
" <td>409.1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>60</td>\n",
" <td>117</td>\n",
" <td>145</td>\n",
" <td>479.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>60</td>\n",
" <td>103</td>\n",
" <td>135</td>\n",
" <td>340.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>45</td>\n",
" <td>109</td>\n",
" <td>175</td>\n",
" <td>282.4</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>45</td>\n",
" <td>117</td>\n",
" <td>148</td>\n",
" <td>406.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>164</th>\n",
" <td>60</td>\n",
" <td>105</td>\n",
" <td>140</td>\n",
" <td>290.8</td>\n",
" </tr>\n",
" <tr>\n",
" <th>165</th>\n",
" <td>60</td>\n",
" <td>110</td>\n",
" <td>145</td>\n",
" <td>300.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>166</th>\n",
" <td>60</td>\n",
" <td>115</td>\n",
" <td>145</td>\n",
" <td>310.2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>167</th>\n",
" <td>75</td>\n",
" <td>120</td>\n",
" <td>150</td>\n",
" <td>320.4</td>\n",
" </tr>\n",
" <tr>\n",
" <th>168</th>\n",
" <td>75</td>\n",
" <td>125</td>\n",
" <td>150</td>\n",
" <td>330.4</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>169 rows × 4 columns</p>\n",
"</div>"
],
"text/plain": [
" Duration Pulse Maxpulse Calories\n",
"0 60 110 130 409.1\n",
"1 60 117 145 479.0\n",
"2 60 103 135 340.0\n",
"3 45 109 175 282.4\n",
"4 45 117 148 406.0\n",
".. ... ... ... ...\n",
"164 60 105 140 290.8\n",
"165 60 110 145 300.0\n",
"166 60 115 145 310.2\n",
"167 75 120 150 320.4\n",
"168 75 125 150 330.4\n",
"\n",
"[169 rows x 4 columns]"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "59980378-83d8-4ec4-99e4-d29557d367bb",
"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>Duration</th>\n",
" <th>Pulse</th>\n",
" <th>Maxpulse</th>\n",
" <th>Calories</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>Duration</th>\n",
" <td>1.000000</td>\n",
" <td>-0.155408</td>\n",
" <td>0.009403</td>\n",
" <td>0.922717</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Pulse</th>\n",
" <td>-0.155408</td>\n",
" <td>1.000000</td>\n",
" <td>0.786535</td>\n",
" <td>0.025121</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Maxpulse</th>\n",
" <td>0.009403</td>\n",
" <td>0.786535</td>\n",
" <td>1.000000</td>\n",
" <td>0.203813</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Calories</th>\n",
" <td>0.922717</td>\n",
" <td>0.025121</td>\n",
" <td>0.203813</td>\n",
" <td>1.000000</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Duration Pulse Maxpulse Calories\n",
"Duration 1.000000 -0.155408 0.009403 0.922717\n",
"Pulse -0.155408 1.000000 0.786535 0.025121\n",
"Maxpulse 0.009403 0.786535 1.000000 0.203813\n",
"Calories 0.922717 0.025121 0.203813 1.000000"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# correlation (1 / -1 --> good, ~0, bad)\n",
"df.corr()"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "7c279538-3d8d-4add-a30c-5c426c5c714f",
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAjoAAAGdCAYA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/Pe//9WsU1RUhOzsbK/tZWdno6ioyHBfdrsdFRUVmh+CIIhmD/XRiQlsNhtycnKQn5+PcePG4Y477sA333yDCRMm4LrrrtOsO3nyZL+DNN9//3107twZ8fHxaNWqFW666Sa+TJIkvPrqq+jQoQMSEhLQu3dv/Oc//4nSu4oNQk5dhcLHH3+MO+64w2tg18SJE/n/e/Togc6dO6N///7YsmULn7gqCILX9iRJMnweAKZPn47nnnsugkdPEAQRA7BZV+di6kqSAGdN4+zbmgj4uB4FQ0JCApxOZ8iv27RpEyZNmoQ5c+Zg0KBBOHv2LFatWsWXP/3005g/fz5mzpyJzp07Y+XKlbjzzjvRsmVLXH755fU+3lgmaoHOqlWrsHfvXnz55ZcB1+3bty+sViv279+Pvn37IicnB6dOnfJa7/Tp02jVqpXhNqZOnYpHH32UP66oqEB+fn793wBBEEQMcE6bkZ01wEt5jbPvp04CcfXz12zYsAH/+te/cOWVV4b82qNHjyIpKQmjR49GSkoK2rZtiz59+gCQi4XefPNNLF++HAMHDgQAdOjQAatXr8aHH354zgY6UUtdzZo1C/369UPv3r0Drrtz5044nU7k5uYCAAYOHIjy8nJs2LCBr7N+/XqUl5dj0KBBhtuw2WxITU3V/BAE0bSRRBGn3/s7qsl7V3/IjBwTLFy4EMnJyYiPj8fAgQMxePBgzJgxI+TtDB8+HG3btkWHDh0wfvx4zJs3DzU
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# plotting\n",
"import matplotlib.pyplot as plt\n",
"df.plot()\n",
"\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "e3cff924-55c9-48cc-9c8c-6d98b01bcd8d",
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAkQAAAGwCAYAAABIC3rIAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjYuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZ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FxhYaFiYmLsx1y4cKHRuYqKiuzHNCUoKEjdunVzeAEAAM/oHdVVo1KiFNCgcyLAYtGolCglRRKImlVSUqJz584pLi5OkjRo0CAFBgZq27Zt9mPy8/N14sQJjRgxQpI0fPhw2Ww2HTp0yH7MJ598IpvNZj8GAAB0vFUz0zQyOdKhbGRypFbNTOvwtnj1kVlFRYVOnz5tf5+bm6usrCyFh4crPDxcy5cv13333ae4uDjl5eXpl7/8pSIjI3XvvfdKkqxWq+bOnaslS5YoIiJC4eHhWrp0qfr372+fddavXz9NnDhR8+bN0+uvvy5JevTRRzV58mRmmAEA4EXW4ECtnztEucWVyiupVK+IkA7vGbrKq4Ho008/1ZgxY+zvr47ZmT17tl577TUdP35c69evV1lZmeLi4jRmzBi98847Cg0NtX/mpZdeUqdOnTR9+nRVV1dr3LhxWrdunQICAuzHbNy4UQsXLrTPRps6darTtY8AAEDHSYr0XhC6ymIYDea7oUnl5eWyWq2y2WyMJwIAwE+09O+3X40hAgAAaA8EIgAAYHoEIgAAYHoEIgAAYHoEIgAAYHoEIgAAYHoEIgAAYHoEIgAAYHoEIgAAYHo
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"df.plot(kind = 'scatter', x = 'Duration', y = 'Calories')\n",
"\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": 11,
"id": "75fcadc3-7c9c-4e92-8dcc-6a0551b55bb3",
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAjsAAAGwCAYAAABPSaTdAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjYuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/P9b71AAAACXBIWXMAAA9hAAAPYQGoP6dpAAA/kUlEQVR4nO3de3xU1b3///fkQmqADLmRGAn3SEUQQUQlFEHkogKitiI9p6Lle2orokDEir9q1arQ1motip5vq3Kgp+CvLSBUBLEGok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u2lsVqqiXS6v49Eul8ZmpXJXFgAAIUawY4Nls4Yre2CK17HsgSlaNmu4TSMCACBy2Rrs5OXladq0acrIyJDL5dL69etbvWbfvn2aPn263G63unfvriuvvFKHDx/2tDc0NGjevHlKSUlR165dNX36dB09etTCT9Fx7vhYrZwzSrn3j9Ord16u3PvHaeWcUdx2DiCsFVfUKnd/OTdSwHFsrbNTV1enYcOG6c4779Qtt9zSqv3zzz/XmDFjNGfOHD322GNyu93at2+fvvWtb3leM3/+fG3cuFFr1qxRcnKycnJyNHXqVO3atUvR0dFWfpwO65dCMUEA4Y/aYHA6l2G0uAfaJi6XS+vWrdOMGTM8x2677TbFxsZq1apVbb6nurpaqampWrVqlWbOnClJOnbsmDIzM7Vp0yZNnjzZr59dU1Mjt9ut6upqJSQkBP1ZACCS3P7yh8ovqvQqmRHtcil7YIpWzhll48jQ2fn7/R22OTtNTU164403dOGFF2ry5Mnq2bO
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"df.plot(kind = 'scatter', x = 'Duration', y = 'Maxpulse')\n",
"\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": 13,
"id": "f32fb4d5-9d8a-4ef7-9acf-9322ee98839d",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<AxesSubplot: ylabel='Frequency'>"
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAjsAAAGdCAYAAAD0e7I1AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjYuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/P9b71AAAACXBIWXMAAA9hAAAPYQGoP6dpAAAjVElEQVR4nO3df1jV9f3/8cdR4QQOSC05MBEpsTLMmZbT/KRpsPyVxbWVWcuydmlqSWpO5zapFZAuosWVP6oLcc7ZL21eV1lSGs25rtA0jZq5JPwRjFUE+AsU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PmzZo8ebJiYmKUnZ2tmTNn6osvvtD69eu1f/9+jRkzJlBzAgAA+KWdPy/Kzs5WXl6edu7cqREjRmjZsmUaMWKE2rQ53k4JCQlavHixLr/88oAOCwAAcLb8ip2FCxdqwoQJuvfee+XxeE56TNeuXfXiiy82azgAAIDm8it2du3addpjQkNDNX78eH/eHgAAIGD8umcnLy9Pr7zySqPtr7zyivLz85s9FAAAQKD4FTtZWVm66KKLGm3v3LmzMjIymj0UAABAoPgVO6WlpUpISGi0PT4+Xnv27Gn2UAAAAIHiV+x07txZ27dvb7T9448/VqdOnZo9FAAAQKD4FTtjx47VQw89pA0bNqi+vl719fVav369pk2bprFjxwZ6RgAAAL/59dtYjz/+uEpLSzVs2DC1a3f8LRoaGnT33Xdzzw4AAHAUv2InNDRUL730kv7whz/o448/VlhYmHr16qX4+PhAzwcAANAsfsX
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"df[\"Duration\"].plot(kind = 'hist')\n",
"# A histogram shows us the frequency of each interval, \n",
"# e.g. how many workouts lasted between 50 and 60 minutes"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "e1af5196-ce21-4120-8483-ccb2cc48adbc",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"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.10.8"
}
},
"nbformat": 4,
"nbformat_minor": 5
}