{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "16241481-9832-4c3a-bc2e-7946258fbd20",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2024-11-20T08:11:53.534255Z",
     "iopub.status.busy": "2024-11-20T08:11:53.533885Z",
     "iopub.status.idle": "2024-11-20T08:11:53.538612Z",
     "shell.execute_reply": "2024-11-20T08:11:53.537780Z",
     "shell.execute_reply.started": "2024-11-20T08:11:53.534222Z"
    }
   },
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "61194019-7e38-4bc6-814d-7431d7baeac9",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2024-11-20T08:11:54.632275Z",
     "iopub.status.busy": "2024-11-20T08:11:54.631922Z",
     "iopub.status.idle": "2024-11-20T08:11:54.708893Z",
     "shell.execute_reply": "2024-11-20T08:11:54.707952Z",
     "shell.execute_reply.started": "2024-11-20T08:11:54.632243Z"
    }
   },
   "outputs": [],
   "source": [
    "kd = pd.read_csv('https://data.hsbo.de/kunden.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "79f1026e-f587-48b7-ba32-2ebabd5125b1",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2024-11-20T08:11:55.882341Z",
     "iopub.status.busy": "2024-11-20T08:11:55.882023Z",
     "iopub.status.idle": "2024-11-20T08:11:55.893187Z",
     "shell.execute_reply": "2024-11-20T08:11:55.892405Z",
     "shell.execute_reply.started": "2024-11-20T08:11:55.882308Z"
    }
   },
   "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>kundenr</th>\n",
       "      <th>kundengruppe</th>\n",
       "      <th>altersgruppe</th>\n",
       "      <th>artikel</th>\n",
       "      <th>betrag</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>272</td>\n",
       "      <td>Mitarbeiter</td>\n",
       "      <td>41-50</td>\n",
       "      <td>3</td>\n",
       "      <td>0.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>278</td>\n",
       "      <td>Schulkind</td>\n",
       "      <td>6-10</td>\n",
       "      <td>3</td>\n",
       "      <td>0.15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>236</td>\n",
       "      <td>Mitarbeiter</td>\n",
       "      <td>41-50</td>\n",
       "      <td>2</td>\n",
       "      <td>0.05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>271</td>\n",
       "      <td>Schulkind</td>\n",
       "      <td>0-5</td>\n",
       "      <td>2</td>\n",
       "      <td>0.05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>263</td>\n",
       "      <td>Schulkind</td>\n",
       "      <td>11-20</td>\n",
       "      <td>4</td>\n",
       "      <td>0.10</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   kundenr kundengruppe altersgruppe  artikel  betrag\n",
       "0      272  Mitarbeiter        41-50        3    0.10\n",
       "1      278    Schulkind         6-10        3    0.15\n",
       "2      236  Mitarbeiter        41-50        2    0.05\n",
       "3      271    Schulkind          0-5        2    0.05\n",
       "4      263    Schulkind        11-20        4    0.10"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "kd.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "39c6786e-a6bc-44d3-a1c9-cf8fe93b9ae2",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2024-11-20T08:12:05.677065Z",
     "iopub.status.busy": "2024-11-20T08:12:05.676842Z",
     "iopub.status.idle": "2024-11-20T08:12:05.682635Z",
     "shell.execute_reply": "2024-11-20T08:12:05.682090Z",
     "shell.execute_reply.started": "2024-11-20T08:12:05.677048Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "kundenr                                                     11469\n",
       "kundengruppe    MitarbeiterSchulkindMitarbeiterSchulkindSchulk...\n",
       "altersgruppe    41-506-1041-500-511-206-1041-500-56-1011-2031-...\n",
       "artikel                                                       123\n",
       "betrag                                                       4.05\n",
       "dtype: object"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "kd.sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "3126be53-8242-4963-ae72-97ed93ec9435",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2024-11-20T08:15:19.267122Z",
     "iopub.status.busy": "2024-11-20T08:15:19.266766Z",
     "iopub.status.idle": "2024-11-20T08:15:19.272509Z",
     "shell.execute_reply": "2024-11-20T08:15:19.271698Z",
     "shell.execute_reply.started": "2024-11-20T08:15:19.267092Z"
    }
   },
   "outputs": [],
   "source": [
    "umsaetze = kd.loc[:,['artikel','betrag']]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "bfef1d29-ba00-4c9d-8bf1-b057cd234ee2",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2024-11-20T08:15:22.879709Z",
     "iopub.status.busy": "2024-11-20T08:15:22.879346Z",
     "iopub.status.idle": "2024-11-20T08:15:22.889244Z",
     "shell.execute_reply": "2024-11-20T08:15:22.888447Z",
     "shell.execute_reply.started": "2024-11-20T08:15:22.879678Z"
    }
   },
   "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>artikel</th>\n",
       "      <th>betrag</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>3</td>\n",
       "      <td>0.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>3</td>\n",
       "      <td>0.15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2</td>\n",
       "      <td>0.05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2</td>\n",
       "      <td>0.05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4</td>\n",
       "      <td>0.10</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   artikel  betrag\n",
       "0        3    0.10\n",
       "1        3    0.15\n",
       "2        2    0.05\n",
       "3        2    0.05\n",
       "4        4    0.10"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "umsaetze.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "775afa3a-a1fb-444b-8da9-c1233d8fbfc0",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2024-11-20T08:15:28.812961Z",
     "iopub.status.busy": "2024-11-20T08:15:28.812587Z",
     "iopub.status.idle": "2024-11-20T08:15:28.820238Z",
     "shell.execute_reply": "2024-11-20T08:15:28.819504Z",
     "shell.execute_reply.started": "2024-11-20T08:15:28.812929Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "artikel    123.00\n",
       "betrag       4.05\n",
       "dtype: float64"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "umsaetze.sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "adf49e3f-d353-4225-a166-1e76345d1034",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2024-11-20T08:16:23.053278Z",
     "iopub.status.busy": "2024-11-20T08:16:23.052916Z",
     "iopub.status.idle": "2024-11-20T08:16:23.060661Z",
     "shell.execute_reply": "2024-11-20T08:16:23.059889Z",
     "shell.execute_reply.started": "2024-11-20T08:16:23.053247Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "artikel    2.733333\n",
       "betrag     0.090000\n",
       "dtype: float64"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "umsaetze.mean()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "c27fa42b-ff06-4b9e-8431-4378fa0ddac1",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2024-11-20T08:18:27.365341Z",
     "iopub.status.busy": "2024-11-20T08:18:27.364979Z",
     "iopub.status.idle": "2024-11-20T08:18:27.377112Z",
     "shell.execute_reply": "2024-11-20T08:18:27.376110Z",
     "shell.execute_reply.started": "2024-11-20T08:18:27.365311Z"
    }
   },
   "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>kundenr</th>\n",
       "      <th>kundengruppe</th>\n",
       "      <th>altersgruppe</th>\n",
       "      <th>artikel</th>\n",
       "      <th>betrag</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>272</td>\n",
       "      <td>Mitarbeiter</td>\n",
       "      <td>41-50</td>\n",
       "      <td>3</td>\n",
       "      <td>0.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>278</td>\n",
       "      <td>Schulkind</td>\n",
       "      <td>6-10</td>\n",
       "      <td>3</td>\n",
       "      <td>0.15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>236</td>\n",
       "      <td>Mitarbeiter</td>\n",
       "      <td>41-50</td>\n",
       "      <td>2</td>\n",
       "      <td>0.05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>271</td>\n",
       "      <td>Schulkind</td>\n",
       "      <td>0-5</td>\n",
       "      <td>2</td>\n",
       "      <td>0.05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>263</td>\n",
       "      <td>Schulkind</td>\n",
       "      <td>11-20</td>\n",
       "      <td>4</td>\n",
       "      <td>0.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>282</td>\n",
       "      <td>Schulkind</td>\n",
       "      <td>6-10</td>\n",
       "      <td>4</td>\n",
       "      <td>0.15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>269</td>\n",
       "      <td>Mitarbeiter</td>\n",
       "      <td>41-50</td>\n",
       "      <td>2</td>\n",
       "      <td>0.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>261</td>\n",
       "      <td>KigaKind</td>\n",
       "      <td>0-5</td>\n",
       "      <td>2</td>\n",
       "      <td>0.05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>280</td>\n",
       "      <td>Schulkind</td>\n",
       "      <td>6-10</td>\n",
       "      <td>3</td>\n",
       "      <td>0.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>257</td>\n",
       "      <td>Schulkind</td>\n",
       "      <td>11-20</td>\n",
       "      <td>4</td>\n",
       "      <td>0.15</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   kundenr kundengruppe altersgruppe  artikel  betrag\n",
       "0      272  Mitarbeiter        41-50        3    0.10\n",
       "1      278    Schulkind         6-10        3    0.15\n",
       "2      236  Mitarbeiter        41-50        2    0.05\n",
       "3      271    Schulkind          0-5        2    0.05\n",
       "4      263    Schulkind        11-20        4    0.10\n",
       "5      282    Schulkind         6-10        4    0.15\n",
       "6      269  Mitarbeiter        41-50        2    0.10\n",
       "7      261     KigaKind          0-5        2    0.05\n",
       "8      280    Schulkind         6-10        3    0.10\n",
       "9      257    Schulkind        11-20        4    0.15"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "kd.head(10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "b26ef51a-efa4-43c4-91a7-da510f9065a9",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2024-11-20T08:18:44.837822Z",
     "iopub.status.busy": "2024-11-20T08:18:44.837463Z",
     "iopub.status.idle": "2024-11-20T08:18:44.843271Z",
     "shell.execute_reply": "2024-11-20T08:18:44.842469Z",
     "shell.execute_reply.started": "2024-11-20T08:18:44.837792Z"
    }
   },
   "outputs": [],
   "source": [
    "kigaKunden = kd[ kd['kundengruppe'] == 'KigaKind' ]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "4f0a4651-853c-485f-82e6-234b69b640e4",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2024-11-20T08:18:50.897982Z",
     "iopub.status.busy": "2024-11-20T08:18:50.897615Z",
     "iopub.status.idle": "2024-11-20T08:18:50.909026Z",
     "shell.execute_reply": "2024-11-20T08:18:50.908274Z",
     "shell.execute_reply.started": "2024-11-20T08:18:50.897951Z"
    }
   },
   "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>kundenr</th>\n",
       "      <th>kundengruppe</th>\n",
       "      <th>altersgruppe</th>\n",
       "      <th>artikel</th>\n",
       "      <th>betrag</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>261</td>\n",
       "      <td>KigaKind</td>\n",
       "      <td>0-5</td>\n",
       "      <td>2</td>\n",
       "      <td>0.05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>251</td>\n",
       "      <td>KigaKind</td>\n",
       "      <td>0-5</td>\n",
       "      <td>3</td>\n",
       "      <td>0.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>283</td>\n",
       "      <td>KigaKind</td>\n",
       "      <td>0-5</td>\n",
       "      <td>3</td>\n",
       "      <td>0.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>253</td>\n",
       "      <td>KigaKind</td>\n",
       "      <td>0-5</td>\n",
       "      <td>1</td>\n",
       "      <td>0.05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>222</td>\n",
       "      <td>KigaKind</td>\n",
       "      <td>0-5</td>\n",
       "      <td>3</td>\n",
       "      <td>0.05</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    kundenr kundengruppe altersgruppe  artikel  betrag\n",
       "7       261     KigaKind          0-5        2    0.05\n",
       "13      251     KigaKind          0-5        3    0.10\n",
       "15      283     KigaKind          0-5        3    0.10\n",
       "19      253     KigaKind          0-5        1    0.05\n",
       "21      222     KigaKind          0-5        3    0.05"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "kigaKunden.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "1552f737-277d-431c-a18a-5f319df160b0",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2024-11-20T08:19:06.877206Z",
     "iopub.status.busy": "2024-11-20T08:19:06.876892Z",
     "iopub.status.idle": "2024-11-20T08:19:06.883035Z",
     "shell.execute_reply": "2024-11-20T08:19:06.882274Z",
     "shell.execute_reply.started": "2024-11-20T08:19:06.877180Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "kundenr                                                      1751\n",
       "kundengruppe    KigaKindKigaKindKigaKindKigaKindKigaKindKigaKi...\n",
       "altersgruppe                              0-50-50-50-50-50-511-20\n",
       "artikel                                                        19\n",
       "betrag                                                        0.6\n",
       "dtype: object"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "kigaKunden.sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "461023fe-f7da-4c00-8b67-e60fdc26a814",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2024-11-20T08:19:43.932787Z",
     "iopub.status.busy": "2024-11-20T08:19:43.932426Z",
     "iopub.status.idle": "2024-11-20T08:19:43.950261Z",
     "shell.execute_reply": "2024-11-20T08:19:43.949567Z",
     "shell.execute_reply.started": "2024-11-20T08:19:43.932758Z"
    }
   },
   "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>kundenr</th>\n",
       "      <th>artikel</th>\n",
       "      <th>betrag</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>7.000000</td>\n",
       "      <td>7.000000</td>\n",
       "      <td>7.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>250.142857</td>\n",
       "      <td>2.714286</td>\n",
       "      <td>0.085714</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>25.576217</td>\n",
       "      <td>0.951190</td>\n",
       "      <td>0.037796</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>211.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.050000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>236.500000</td>\n",
       "      <td>2.500000</td>\n",
       "      <td>0.050000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>253.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>0.100000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>265.500000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>0.100000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>283.000000</td>\n",
       "      <td>4.000000</td>\n",
       "      <td>0.150000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          kundenr   artikel    betrag\n",
       "count    7.000000  7.000000  7.000000\n",
       "mean   250.142857  2.714286  0.085714\n",
       "std     25.576217  0.951190  0.037796\n",
       "min    211.000000  1.000000  0.050000\n",
       "25%    236.500000  2.500000  0.050000\n",
       "50%    253.000000  3.000000  0.100000\n",
       "75%    265.500000  3.000000  0.100000\n",
       "max    283.000000  4.000000  0.150000"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "kigaKunden.describe()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "82547e96-0575-4ca9-86d3-33c4d7fa844c",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2024-11-20T08:20:54.307133Z",
     "iopub.status.busy": "2024-11-20T08:20:54.306772Z",
     "iopub.status.idle": "2024-11-20T08:20:54.312417Z",
     "shell.execute_reply": "2024-11-20T08:20:54.311591Z",
     "shell.execute_reply.started": "2024-11-20T08:20:54.307103Z"
    }
   },
   "outputs": [],
   "source": [
    "studKunden = kd[ kd['kundengruppe'] == 'Student' ]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "a80e0b78-81e0-4404-9f9a-7e224224e0f9",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2024-11-20T08:20:58.471243Z",
     "iopub.status.busy": "2024-11-20T08:20:58.470886Z",
     "iopub.status.idle": "2024-11-20T08:20:58.489318Z",
     "shell.execute_reply": "2024-11-20T08:20:58.488468Z",
     "shell.execute_reply.started": "2024-11-20T08:20:58.471211Z"
    }
   },
   "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>kundenr</th>\n",
       "      <th>artikel</th>\n",
       "      <th>betrag</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>3.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>3.000000e+00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>248.666667</td>\n",
       "      <td>2.666667</td>\n",
       "      <td>5.000000e-02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>16.502525</td>\n",
       "      <td>1.154701</td>\n",
       "      <td>8.498375e-18</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>235.000000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>5.000000e-02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>239.500000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>5.000000e-02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>244.000000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>5.000000e-02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>255.500000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>5.000000e-02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>267.000000</td>\n",
       "      <td>4.000000</td>\n",
       "      <td>5.000000e-02</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          kundenr   artikel        betrag\n",
       "count    3.000000  3.000000  3.000000e+00\n",
       "mean   248.666667  2.666667  5.000000e-02\n",
       "std     16.502525  1.154701  8.498375e-18\n",
       "min    235.000000  2.000000  5.000000e-02\n",
       "25%    239.500000  2.000000  5.000000e-02\n",
       "50%    244.000000  2.000000  5.000000e-02\n",
       "75%    255.500000  3.000000  5.000000e-02\n",
       "max    267.000000  4.000000  5.000000e-02"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "studKunden.describe()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "4fd96e47-d2fa-4819-beaf-5ed7065e8fcd",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2024-11-20T08:23:06.495745Z",
     "iopub.status.busy": "2024-11-20T08:23:06.495386Z",
     "iopub.status.idle": "2024-11-20T08:23:06.506450Z",
     "shell.execute_reply": "2024-11-20T08:23:06.505714Z",
     "shell.execute_reply.started": "2024-11-20T08:23:06.495715Z"
    }
   },
   "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>kundenr</th>\n",
       "      <th>kundengruppe</th>\n",
       "      <th>altersgruppe</th>\n",
       "      <th>artikel</th>\n",
       "      <th>betrag</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>272</td>\n",
       "      <td>Mitarbeiter</td>\n",
       "      <td>41-50</td>\n",
       "      <td>3</td>\n",
       "      <td>0.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>278</td>\n",
       "      <td>Schulkind</td>\n",
       "      <td>6-10</td>\n",
       "      <td>3</td>\n",
       "      <td>0.15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>236</td>\n",
       "      <td>Mitarbeiter</td>\n",
       "      <td>41-50</td>\n",
       "      <td>2</td>\n",
       "      <td>0.05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>271</td>\n",
       "      <td>Schulkind</td>\n",
       "      <td>0-5</td>\n",
       "      <td>2</td>\n",
       "      <td>0.05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>263</td>\n",
       "      <td>Schulkind</td>\n",
       "      <td>11-20</td>\n",
       "      <td>4</td>\n",
       "      <td>0.10</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   kundenr kundengruppe altersgruppe  artikel  betrag\n",
       "0      272  Mitarbeiter        41-50        3    0.10\n",
       "1      278    Schulkind         6-10        3    0.15\n",
       "2      236  Mitarbeiter        41-50        2    0.05\n",
       "3      271    Schulkind          0-5        2    0.05\n",
       "4      263    Schulkind        11-20        4    0.10"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "kd.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "84f110d8-27d1-4d4b-99fb-451e31ece05f",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2024-11-20T08:23:40.936437Z",
     "iopub.status.busy": "2024-11-20T08:23:40.936210Z",
     "iopub.status.idle": "2024-11-20T08:23:40.941839Z",
     "shell.execute_reply": "2024-11-20T08:23:40.940904Z",
     "shell.execute_reply.started": "2024-11-20T08:23:40.936421Z"
    }
   },
   "outputs": [],
   "source": [
    "df = kd.loc[:,['altersgruppe','betrag']]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "7029ad2f-f1a2-4581-8296-f585a5f4568c",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2024-11-20T08:23:44.073310Z",
     "iopub.status.busy": "2024-11-20T08:23:44.072481Z",
     "iopub.status.idle": "2024-11-20T08:23:44.082495Z",
     "shell.execute_reply": "2024-11-20T08:23:44.081718Z",
     "shell.execute_reply.started": "2024-11-20T08:23:44.073276Z"
    }
   },
   "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>altersgruppe</th>\n",
       "      <th>betrag</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>41-50</td>\n",
       "      <td>0.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>6-10</td>\n",
       "      <td>0.15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>41-50</td>\n",
       "      <td>0.05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0-5</td>\n",
       "      <td>0.05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>11-20</td>\n",
       "      <td>0.10</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  altersgruppe  betrag\n",
       "0        41-50    0.10\n",
       "1         6-10    0.15\n",
       "2        41-50    0.05\n",
       "3          0-5    0.05\n",
       "4        11-20    0.10"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "2b02f293-fe09-45c9-9fe5-d35f06fa7ef6",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2024-11-20T08:24:01.918713Z",
     "iopub.status.busy": "2024-11-20T08:24:01.918351Z",
     "iopub.status.idle": "2024-11-20T08:24:01.929829Z",
     "shell.execute_reply": "2024-11-20T08:24:01.928991Z",
     "shell.execute_reply.started": "2024-11-20T08:24:01.918684Z"
    }
   },
   "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>betrag</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>altersgruppe</th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0-5</th>\n",
       "      <td>0.50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11-20</th>\n",
       "      <td>1.05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21-30</th>\n",
       "      <td>0.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>31-40</th>\n",
       "      <td>0.45</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41-50</th>\n",
       "      <td>0.50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>51-60</th>\n",
       "      <td>0.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6-10</th>\n",
       "      <td>1.20</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              betrag\n",
       "altersgruppe        \n",
       "0-5             0.50\n",
       "11-20           1.05\n",
       "21-30           0.25\n",
       "31-40           0.45\n",
       "41-50           0.50\n",
       "51-60           0.10\n",
       "6-10            1.20"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.groupby('altersgruppe').sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "567bb803-cd8e-4a54-91eb-e3cce17160fe",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2024-11-20T08:24:59.066670Z",
     "iopub.status.busy": "2024-11-20T08:24:59.066302Z",
     "iopub.status.idle": "2024-11-20T08:24:59.079725Z",
     "shell.execute_reply": "2024-11-20T08:24:59.078944Z",
     "shell.execute_reply.started": "2024-11-20T08:24:59.066640Z"
    }
   },
   "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>kundenr</th>\n",
       "      <th>kundengruppe</th>\n",
       "      <th>artikel</th>\n",
       "      <th>betrag</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>altersgruppe</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0-5</th>\n",
       "      <td>1752</td>\n",
       "      <td>SchulkindKigaKindKigaKindKigaKindKigaKindKigaK...</td>\n",
       "      <td>17</td>\n",
       "      <td>0.50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11-20</th>\n",
       "      <td>2648</td>\n",
       "      <td>SchulkindSchulkindStudentSchulkindSchulkindSch...</td>\n",
       "      <td>31</td>\n",
       "      <td>1.05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21-30</th>\n",
       "      <td>958</td>\n",
       "      <td>StudentMitarbeiterGastStudent</td>\n",
       "      <td>9</td>\n",
       "      <td>0.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>31-40</th>\n",
       "      <td>1417</td>\n",
       "      <td>MitarbeiterMitarbeiterGastMitarbeiterMitarbeit...</td>\n",
       "      <td>14</td>\n",
       "      <td>0.45</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41-50</th>\n",
       "      <td>1546</td>\n",
       "      <td>MitarbeiterMitarbeiterMitarbeiterMitarbeiterMi...</td>\n",
       "      <td>15</td>\n",
       "      <td>0.50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>51-60</th>\n",
       "      <td>471</td>\n",
       "      <td>MitarbeiterMitarbeiter</td>\n",
       "      <td>3</td>\n",
       "      <td>0.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6-10</th>\n",
       "      <td>2677</td>\n",
       "      <td>SchulkindSchulkindSchulkindSchulkindSchulkindS...</td>\n",
       "      <td>34</td>\n",
       "      <td>1.20</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              kundenr                                       kundengruppe  \\\n",
       "altersgruppe                                                               \n",
       "0-5              1752  SchulkindKigaKindKigaKindKigaKindKigaKindKigaK...   \n",
       "11-20            2648  SchulkindSchulkindStudentSchulkindSchulkindSch...   \n",
       "21-30             958                      StudentMitarbeiterGastStudent   \n",
       "31-40            1417  MitarbeiterMitarbeiterGastMitarbeiterMitarbeit...   \n",
       "41-50            1546  MitarbeiterMitarbeiterMitarbeiterMitarbeiterMi...   \n",
       "51-60             471                             MitarbeiterMitarbeiter   \n",
       "6-10             2677  SchulkindSchulkindSchulkindSchulkindSchulkindS...   \n",
       "\n",
       "              artikel  betrag  \n",
       "altersgruppe                   \n",
       "0-5                17    0.50  \n",
       "11-20              31    1.05  \n",
       "21-30               9    0.25  \n",
       "31-40              14    0.45  \n",
       "41-50              15    0.50  \n",
       "51-60               3    0.10  \n",
       "6-10               34    1.20  "
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "kd.groupby('altersgruppe').sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "id": "edf0147c-a473-455a-ba1c-a4b8aee48cf8",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2024-11-20T08:25:23.911834Z",
     "iopub.status.busy": "2024-11-20T08:25:23.911466Z",
     "iopub.status.idle": "2024-11-20T08:25:23.918460Z",
     "shell.execute_reply": "2024-11-20T08:25:23.917793Z",
     "shell.execute_reply.started": "2024-11-20T08:25:23.911803Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "kundenr           int64\n",
       "kundengruppe     object\n",
       "altersgruppe     object\n",
       "artikel           int64\n",
       "betrag          float64\n",
       "dtype: object"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "kd.dtypes"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "270a2ce9-04b1-4280-8b5f-c18e4d8f9650",
   "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.11.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
