{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "e2966077-584c-45c5-9304-ec0bf44bdee5",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-06-03T12:46:11.066788Z",
     "iopub.status.busy": "2026-06-03T12:46:11.066449Z",
     "iopub.status.idle": "2026-06-03T12:46:11.381610Z",
     "shell.execute_reply": "2026-06-03T12:46:11.380527Z",
     "shell.execute_reply.started": "2026-06-03T12:46:11.066752Z"
    }
   },
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "8e86e6b2-a689-4291-84e9-e57ed6e30587",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-06-03T12:46:21.416131Z",
     "iopub.status.busy": "2026-06-03T12:46:21.415547Z",
     "iopub.status.idle": "2026-06-03T12:46:21.419635Z",
     "shell.execute_reply": "2026-06-03T12:46:21.418759Z",
     "shell.execute_reply.started": "2026-06-03T12:46:21.416081Z"
    }
   },
   "outputs": [],
   "source": [
    "url = 'https://data.hsbo.de/kunden.csv'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "e62faaa7-6150-433a-bf26-ac4c14fb0952",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-06-03T12:46:28.787274Z",
     "iopub.status.busy": "2026-06-03T12:46:28.787015Z",
     "iopub.status.idle": "2026-06-03T12:46:28.905264Z",
     "shell.execute_reply": "2026-06-03T12:46:28.904229Z",
     "shell.execute_reply.started": "2026-06-03T12:46:28.787253Z"
    }
   },
   "outputs": [],
   "source": [
    "daten = pd.read_csv(url)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "95b4307e-fe17-47f8-937a-e6f9496d3df5",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-06-03T12:46:30.789398Z",
     "iopub.status.busy": "2026-06-03T12:46:30.789133Z",
     "iopub.status.idle": "2026-06-03T12:46:30.806230Z",
     "shell.execute_reply": "2026-06-03T12:46:30.805104Z",
     "shell.execute_reply.started": "2026-06-03T12:46:30.789371Z"
    }
   },
   "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>BestellNr</th>\n",
       "      <th>Altersgruppe</th>\n",
       "      <th>Kundengruppe</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>211</td>\n",
       "      <td>0-5</td>\n",
       "      <td>KigaKind</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>215</td>\n",
       "      <td>31-40</td>\n",
       "      <td>Mitarbeiter</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>219</td>\n",
       "      <td>6-10</td>\n",
       "      <td>Schulkind</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>222</td>\n",
       "      <td>0-5</td>\n",
       "      <td>KigaKind</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>229</td>\n",
       "      <td>41-50</td>\n",
       "      <td>Mitarbeiter</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   BestellNr Altersgruppe Kundengruppe\n",
       "0        211          0-5     KigaKind\n",
       "1        215        31-40  Mitarbeiter\n",
       "2        219         6-10    Schulkind\n",
       "3        222          0-5     KigaKind\n",
       "4        229        41-50  Mitarbeiter"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "daten.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "a5f18d87-448a-4b8e-b930-05bd6af56c66",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-06-03T12:48:39.030180Z",
     "iopub.status.busy": "2026-06-03T12:48:39.029862Z",
     "iopub.status.idle": "2026-06-03T12:48:39.036864Z",
     "shell.execute_reply": "2026-06-03T12:48:39.035801Z",
     "shell.execute_reply.started": "2026-06-03T12:48:39.030151Z"
    }
   },
   "outputs": [],
   "source": [
    "kiga = daten[ daten['Kundengruppe'] == 'KigaKind' ]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "048901d0-cf20-4f0e-9263-e176173927d7",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-06-03T12:52:52.524960Z",
     "iopub.status.busy": "2026-06-03T12:52:52.524575Z",
     "iopub.status.idle": "2026-06-03T12:52:52.539865Z",
     "shell.execute_reply": "2026-06-03T12:52:52.538816Z",
     "shell.execute_reply.started": "2026-06-03T12:52:52.524927Z"
    }
   },
   "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>BestellNr</th>\n",
       "      <th>Altersgruppe</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Kundengruppe</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Gast</th>\n",
       "      <td>2987</td>\n",
       "      <td>31-4021-3041-5041-50&gt; 6051-60&gt; 6031-4041-5031-40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>KigaKind</th>\n",
       "      <td>3093</td>\n",
       "      <td>0-50-50-50-50-511-200-50-50-50-50-5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Mitarbeiter</th>\n",
       "      <td>7021</td>\n",
       "      <td>31-4041-5051-6031-4041-5051-6031-4031-4021-303...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Schulkind</th>\n",
       "      <td>15015</td>\n",
       "      <td>6-1011-206-1011-2011-2011-206-1011-206-1011-20...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Student</th>\n",
       "      <td>1976</td>\n",
       "      <td>21-3021-3011-2011-20&gt; 6011-2021-30</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              BestellNr                                       Altersgruppe\n",
       "Kundengruppe                                                              \n",
       "Gast               2987   31-4021-3041-5041-50> 6051-60> 6031-4041-5031-40\n",
       "KigaKind           3093                0-50-50-50-50-511-200-50-50-50-50-5\n",
       "Mitarbeiter        7021  31-4041-5051-6031-4041-5051-6031-4031-4021-303...\n",
       "Schulkind         15015  6-1011-206-1011-2011-2011-206-1011-206-1011-20...\n",
       "Student            1976                 21-3021-3011-2011-20> 6011-2021-30"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "daten.groupby('Kundengruppe').sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "b4d241bf-4631-4398-98e5-5cf4cec7b09d",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-06-03T12:52:29.501995Z",
     "iopub.status.busy": "2026-06-03T12:52:29.501544Z",
     "iopub.status.idle": "2026-06-03T12:52:29.540232Z",
     "shell.execute_reply": "2026-06-03T12:52:29.539031Z",
     "shell.execute_reply.started": "2026-06-03T12:52:29.501958Z"
    }
   },
   "outputs": [],
   "source": [
    "df = pd.read_csv('https://data.hsbo.de/Kundendaten.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "06051857-0dfc-4041-bed8-9fedba9e1668",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-06-03T12:52:29.962525Z",
     "iopub.status.busy": "2026-06-03T12:52:29.962262Z",
     "iopub.status.idle": "2026-06-03T12:52:29.973347Z",
     "shell.execute_reply": "2026-06-03T12:52:29.972304Z",
     "shell.execute_reply.started": "2026-06-03T12:52:29.962497Z"
    }
   },
   "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",
       "    </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",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>278</td>\n",
       "      <td>Schulkind</td>\n",
       "      <td>6-10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>236</td>\n",
       "      <td>Mitarbeiter</td>\n",
       "      <td>41-50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>271</td>\n",
       "      <td>Schulkind</td>\n",
       "      <td>0-5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>263</td>\n",
       "      <td>Schulkind</td>\n",
       "      <td>11-20</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   KundeNr Kundengruppe Altersgruppe\n",
       "0      272  Mitarbeiter        41-50\n",
       "1      278    Schulkind         6-10\n",
       "2      236  Mitarbeiter        41-50\n",
       "3      271    Schulkind          0-5\n",
       "4      263    Schulkind        11-20"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "268027fe-ce9d-45eb-a2b6-d1b074aa92f3",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-06-03T13:11:39.152864Z",
     "iopub.status.busy": "2026-06-03T13:11:39.152585Z",
     "iopub.status.idle": "2026-06-03T13:11:39.236882Z",
     "shell.execute_reply": "2026-06-03T13:11:39.235608Z",
     "shell.execute_reply.started": "2026-06-03T13:11:39.152845Z"
    }
   },
   "outputs": [],
   "source": [
    "kuchen = pd.read_csv('https://data.hsbo.de/kuchen.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "4c0aa646-4029-46b3-b51c-b21365ce17ca",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-06-03T13:11:53.555157Z",
     "iopub.status.busy": "2026-06-03T13:11:53.554727Z",
     "iopub.status.idle": "2026-06-03T13:11:53.567767Z",
     "shell.execute_reply": "2026-06-03T13:11:53.566650Z",
     "shell.execute_reply.started": "2026-06-03T13:11:53.555123Z"
    }
   },
   "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>Datum</th>\n",
       "      <th>BonNr</th>\n",
       "      <th>Apfelkuchen</th>\n",
       "      <th>Kirschkuchen</th>\n",
       "      <th>Sacher</th>\n",
       "      <th>Zitronenkuchen</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2023-10-12</td>\n",
       "      <td>77</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2023-10-12</td>\n",
       "      <td>78</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2023-10-12</td>\n",
       "      <td>79</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2023-10-12</td>\n",
       "      <td>80</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2023-10-12</td>\n",
       "      <td>81</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        Datum  BonNr  Apfelkuchen  Kirschkuchen  Sacher  Zitronenkuchen\n",
       "0  2023-10-12     77            0             0       0               0\n",
       "1  2023-10-12     78            0             0       0               0\n",
       "2  2023-10-12     79            1             0       0               0\n",
       "3  2023-10-12     80            0             0       0               0\n",
       "4  2023-10-12     81            0             0       0               0"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "kuchen.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "a8be45b0-4659-4e5d-872a-cb9a212a7f84",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-06-03T13:12:04.933155Z",
     "iopub.status.busy": "2026-06-03T13:12:04.932734Z",
     "iopub.status.idle": "2026-06-03T13:12:04.943066Z",
     "shell.execute_reply": "2026-06-03T13:12:04.941813Z",
     "shell.execute_reply.started": "2026-06-03T13:12:04.933122Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Datum               str\n",
       "BonNr             int64\n",
       "Apfelkuchen       int64\n",
       "Kirschkuchen      int64\n",
       "Sacher            int64\n",
       "Zitronenkuchen    int64\n",
       "dtype: object"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "kuchen.dtypes"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "3bb9740a-0f05-4e15-a7ba-abe2cda23fa1",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-06-03T13:13:30.267477Z",
     "iopub.status.busy": "2026-06-03T13:13:30.266821Z",
     "iopub.status.idle": "2026-06-03T13:13:30.275724Z",
     "shell.execute_reply": "2026-06-03T13:13:30.274904Z",
     "shell.execute_reply.started": "2026-06-03T13:13:30.267441Z"
    }
   },
   "outputs": [],
   "source": [
    "kuchen['Datum'] = pd.to_datetime(kuchen['Datum'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "fcf46f90-50b5-4447-b0b0-bf25e8311368",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-06-03T13:13:34.188272Z",
     "iopub.status.busy": "2026-06-03T13:13:34.187896Z",
     "iopub.status.idle": "2026-06-03T13:13:34.201424Z",
     "shell.execute_reply": "2026-06-03T13:13:34.200120Z",
     "shell.execute_reply.started": "2026-06-03T13:13:34.188234Z"
    }
   },
   "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>Datum</th>\n",
       "      <th>BonNr</th>\n",
       "      <th>Apfelkuchen</th>\n",
       "      <th>Kirschkuchen</th>\n",
       "      <th>Sacher</th>\n",
       "      <th>Zitronenkuchen</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2023-10-12</td>\n",
       "      <td>77</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2023-10-12</td>\n",
       "      <td>78</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2023-10-12</td>\n",
       "      <td>79</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2023-10-12</td>\n",
       "      <td>80</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2023-10-12</td>\n",
       "      <td>81</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       Datum  BonNr  Apfelkuchen  Kirschkuchen  Sacher  Zitronenkuchen\n",
       "0 2023-10-12     77            0             0       0               0\n",
       "1 2023-10-12     78            0             0       0               0\n",
       "2 2023-10-12     79            1             0       0               0\n",
       "3 2023-10-12     80            0             0       0               0\n",
       "4 2023-10-12     81            0             0       0               0"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "kuchen.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "efd8e654-5498-4773-a6a2-47f1023b8fa5",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-06-03T13:13:37.709119Z",
     "iopub.status.busy": "2026-06-03T13:13:37.708790Z",
     "iopub.status.idle": "2026-06-03T13:13:37.717347Z",
     "shell.execute_reply": "2026-06-03T13:13:37.716001Z",
     "shell.execute_reply.started": "2026-06-03T13:13:37.709090Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Datum             datetime64[us]\n",
       "BonNr                      int64\n",
       "Apfelkuchen                int64\n",
       "Kirschkuchen               int64\n",
       "Sacher                     int64\n",
       "Zitronenkuchen             int64\n",
       "dtype: object"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "kuchen.dtypes"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "8b746c9e-7022-404d-9916-d89821f96cf2",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-06-03T13:14:47.735557Z",
     "iopub.status.busy": "2026-06-03T13:14:47.735147Z",
     "iopub.status.idle": "2026-06-03T13:14:47.743184Z",
     "shell.execute_reply": "2026-06-03T13:14:47.741936Z",
     "shell.execute_reply.started": "2026-06-03T13:14:47.735522Z"
    }
   },
   "outputs": [],
   "source": [
    "kuchen['Wochentag'] = kuchen['Datum'].dt.day_name()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "01dd0e27-978c-4649-b831-7aa30e443705",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-06-03T13:16:19.788194Z",
     "iopub.status.busy": "2026-06-03T13:16:19.787718Z",
     "iopub.status.idle": "2026-06-03T13:16:19.802301Z",
     "shell.execute_reply": "2026-06-03T13:16:19.801029Z",
     "shell.execute_reply.started": "2026-06-03T13:16:19.788151Z"
    }
   },
   "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>Datum</th>\n",
       "      <th>BonNr</th>\n",
       "      <th>Apfelkuchen</th>\n",
       "      <th>Kirschkuchen</th>\n",
       "      <th>Sacher</th>\n",
       "      <th>Zitronenkuchen</th>\n",
       "      <th>Wochentag</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2023-10-12</td>\n",
       "      <td>77</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>Thursday</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2023-10-12</td>\n",
       "      <td>78</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>Thursday</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2023-10-12</td>\n",
       "      <td>79</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>Thursday</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2023-10-12</td>\n",
       "      <td>80</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>Thursday</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2023-10-12</td>\n",
       "      <td>81</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>Thursday</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       Datum  BonNr  Apfelkuchen  Kirschkuchen  Sacher  Zitronenkuchen  \\\n",
       "0 2023-10-12     77            0             0       0               0   \n",
       "1 2023-10-12     78            0             0       0               0   \n",
       "2 2023-10-12     79            1             0       0               0   \n",
       "3 2023-10-12     80            0             0       0               0   \n",
       "4 2023-10-12     81            0             0       0               0   \n",
       "\n",
       "  Wochentag  \n",
       "0  Thursday  \n",
       "1  Thursday  \n",
       "2  Thursday  \n",
       "3  Thursday  \n",
       "4  Thursday  "
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "kuchen.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "id": "eba6b9b9-1a40-42eb-b687-768764aa5dba",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-06-03T13:16:51.483257Z",
     "iopub.status.busy": "2026-06-03T13:16:51.482791Z",
     "iopub.status.idle": "2026-06-03T13:16:51.490934Z",
     "shell.execute_reply": "2026-06-03T13:16:51.489795Z",
     "shell.execute_reply.started": "2026-06-03T13:16:51.483221Z"
    }
   },
   "outputs": [],
   "source": [
    "verkleinert = kuchen[['Apfelkuchen', 'Kirschkuchen', 'Sacher', 'Zitronenkuchen', 'Wochentag']]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "id": "72cb37cd-7287-4453-bccd-d4ef4c8d493c",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-06-03T13:17:17.273740Z",
     "iopub.status.busy": "2026-06-03T13:17:17.273309Z",
     "iopub.status.idle": "2026-06-03T13:17:17.286466Z",
     "shell.execute_reply": "2026-06-03T13:17:17.285374Z",
     "shell.execute_reply.started": "2026-06-03T13:17:17.273703Z"
    }
   },
   "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>Apfelkuchen</th>\n",
       "      <th>Kirschkuchen</th>\n",
       "      <th>Sacher</th>\n",
       "      <th>Zitronenkuchen</th>\n",
       "      <th>Wochentag</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>Thursday</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>Thursday</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>Thursday</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>Thursday</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>Thursday</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Apfelkuchen  Kirschkuchen  Sacher  Zitronenkuchen Wochentag\n",
       "0            0             0       0               0  Thursday\n",
       "1            0             0       0               0  Thursday\n",
       "2            1             0       0               0  Thursday\n",
       "3            0             0       0               0  Thursday\n",
       "4            0             0       0               0  Thursday"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "verkleinert.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "id": "d0c18d95-6b8e-4e63-933c-870da067942d",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-06-03T13:24:19.535686Z",
     "iopub.status.busy": "2026-06-03T13:24:19.535374Z",
     "iopub.status.idle": "2026-06-03T13:24:19.542402Z",
     "shell.execute_reply": "2026-06-03T13:24:19.541553Z",
     "shell.execute_reply.started": "2026-06-03T13:24:19.535655Z"
    }
   },
   "outputs": [],
   "source": [
    "nachWochentag = verkleinert.groupby('Wochentag').sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "id": "bd3c52c7-eb45-4abb-8825-ede6012a96f1",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-06-03T13:24:23.503449Z",
     "iopub.status.busy": "2026-06-03T13:24:23.503159Z",
     "iopub.status.idle": "2026-06-03T13:24:23.513555Z",
     "shell.execute_reply": "2026-06-03T13:24:23.512696Z",
     "shell.execute_reply.started": "2026-06-03T13:24:23.503421Z"
    }
   },
   "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>Apfelkuchen</th>\n",
       "      <th>Kirschkuchen</th>\n",
       "      <th>Sacher</th>\n",
       "      <th>Zitronenkuchen</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Wochentag</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Friday</th>\n",
       "      <td>14</td>\n",
       "      <td>9</td>\n",
       "      <td>6</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Monday</th>\n",
       "      <td>13</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Saturday</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Sunday</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Thursday</th>\n",
       "      <td>7</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "           Apfelkuchen  Kirschkuchen  Sacher  Zitronenkuchen\n",
       "Wochentag                                                   \n",
       "Friday              14             9       6               1\n",
       "Monday              13             3       1               7\n",
       "Saturday             0             0       0               0\n",
       "Sunday               0             0       0               0\n",
       "Thursday             7             2       2               0"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "nachWochentag.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "id": "6e655fba-3c4d-4b33-b467-8147e10ae558",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-06-03T13:25:06.684986Z",
     "iopub.status.busy": "2026-06-03T13:25:06.684662Z",
     "iopub.status.idle": "2026-06-03T13:25:06.692646Z",
     "shell.execute_reply": "2026-06-03T13:25:06.691686Z",
     "shell.execute_reply.started": "2026-06-03T13:25:06.684953Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Wochentag\n",
       "Friday       30\n",
       "Monday       24\n",
       "Saturday      0\n",
       "Sunday        0\n",
       "Thursday     11\n",
       "Tuesday      23\n",
       "Wednesday    63\n",
       "dtype: int64"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "nachWochentag.sum(axis=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "240a94dd-587e-4381-836d-de6735c0c38a",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-06-03T13:15:36.299756Z",
     "iopub.status.busy": "2026-06-03T13:15:36.299325Z",
     "iopub.status.idle": "2026-06-03T13:15:36.317923Z",
     "shell.execute_reply": "2026-06-03T13:15:36.316825Z",
     "shell.execute_reply.started": "2026-06-03T13:15:36.299722Z"
    }
   },
   "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>Datum</th>\n",
       "      <th>BonNr</th>\n",
       "      <th>Apfelkuchen</th>\n",
       "      <th>Kirschkuchen</th>\n",
       "      <th>Sacher</th>\n",
       "      <th>Zitronenkuchen</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Wochentag</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Friday</th>\n",
       "      <td>2024-10-25</td>\n",
       "      <td>284</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Monday</th>\n",
       "      <td>2024-10-28</td>\n",
       "      <td>285</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Saturday</th>\n",
       "      <td>2024-05-04</td>\n",
       "      <td>203</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Sunday</th>\n",
       "      <td>2023-11-19</td>\n",
       "      <td>132</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Thursday</th>\n",
       "      <td>2024-10-10</td>\n",
       "      <td>245</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Tuesday</th>\n",
       "      <td>2024-06-11</td>\n",
       "      <td>242</td>\n",
       "      <td>3</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Wednesday</th>\n",
       "      <td>2024-10-16</td>\n",
       "      <td>247</td>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "               Datum  BonNr  Apfelkuchen  Kirschkuchen  Sacher  Zitronenkuchen\n",
       "Wochentag                                                                     \n",
       "Friday    2024-10-25    284            3             1       1               1\n",
       "Monday    2024-10-28    285            3             1       1               2\n",
       "Saturday  2024-05-04    203            0             0       0               0\n",
       "Sunday    2023-11-19    132            0             0       0               0\n",
       "Thursday  2024-10-10    245            1             1       2               0\n",
       "Tuesday   2024-06-11    242            3             2       1               1\n",
       "Wednesday 2024-10-16    247            3             3       3               3"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "kuchen.groupby('Wochentag').max()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "7a4a8c11-4835-439f-a6ea-4ae1385bff3e",
   "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.13.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
