Compare commits

...

3 Commits

Author SHA1 Message Date
8c6ff86de1 adapted some code for new folder structure
wrote the enrichment_code for oar_id and boat_places
2026-04-10 16:29:38 +02:00
999611c254 commit for sync 2026-04-10 13:53:25 +02:00
bbd66b0164 added comp oar type to document 2026-03-28 18:52:52 +01:00
9 changed files with 617 additions and 48 deletions

4
.gitignore vendored
View File

@@ -2,8 +2,10 @@
# project specific gitignore entries
.venv
*.txt
*temp/
*.xlsx
*.pdf
*.csv
*temp/
########################################################################################
# project specific gitignore entries

View File

@@ -1,15 +1,79 @@
Ruder-ID
S-C2-H-201X-98-B-sk
S-C2-H-201X-97-B-sk
S-C2-H-201X-99-B-sk
S-C2-H-201X-96-B-sk
S-C2-H-201X-98-B-sk
S-C2-H-201X-97-B-sk
S-C2-H-201X-99-B-sk
S-C2-H-201X-96-B-sk
S-C2-H-201X-98-B-sk
S-C2-H-201X-97-B-sk
S-C2-H-201X-99-B-sk
S-C2-H-201X-96-B-sk
S-C2-H-201X-98-B-sk
S-C2-H-201X-97-B-sk
S-C2-M-19XX-01-B/S
S-Sw-M-201X-01-B/S
S-Sw-M-201X-02-B/S
S-Sw-M-201X-03-B/S
S-Sw-M-201X-04-B/S
S-Cr-M-200X-01-B/S
S-Cr-M-200X-02-B/S
S-Cr-M-200X-03-B/S
S-Cr-M-200X-04-B/S
S-Cr-M-200X-05-B/S
S-Cr-M-200X-06-B/S
S-Cr-M-200X-07-B/S
S-Cr-M-200X-08-B/S
S-Cr-M-200X-09-B/S
S-Cr-M-200X-10-B/S
S-Cr-M-200X-11-B/S
S-Cr-H-200X-01-B/S
S-Cr-H-200X-02-B/S
S-Cr-H-200X-03-B/S
S-Cr-H-200X-04-B/S
S-Cr-H-200X-05-B/S
S-C2-H-201X-01-B/S
S-C2-H-201X-02-B/S
S-C2-H-201X-03-B/S
S-C2-H-201X-04-B/S
S-C2-H-201X-05-B/S
S-C2-H-201X-06-B/S
S-C2-H-201X-07-B/S
S-C2-H-201X-08-B/S
S-C2-H-201X-09-B/S
S-C2-H-201X-10-B/S
S-C2-H-201X-11-B/S
S-C2-H-201X-12-B/S
S-C2-H-201X-13-B/S
S-C2-H-201X-14-B/S
S-C2-H-201X-15-B/S
S-C2-H-201X-16-B/S
S-C2-H-201X-17-B/S
S-C2-H-201X-20-B/S-sk
S-C2-H-201X-21-B/S-sk
S-C2-H-201X-22-B/S-sk
S-C2-H-201X-23-B/S-sk
S-C2-H-201X-24-B/S-sk
S-C2-H-201X-25-B/S-sk
S-C2-H-201X-26-B/S-sk
S-C2-H-202X-01-B/S-sk
S-C2-H-202X-02-B/S-sk
S-C2-H-202X-03-B/S-sk
R-Em-H-19XX-00/01
R-Em-H-19XX-02/3
R-Em-H-19XX-02/03
R-Em-H-19XX-04/5
R-Em-H-19XX-04/05
R-Em-H-19XX-06/7
R-Em-H-19XX-06/07
R-Em-H-19XX-08/9
R-Cr-H-200X-00/01
R-Cr-H-200X-02/3
R-Cr-H-200X-02/03
R-Cr-H-200X-04/5
R-Cr-H-200X-04/05
R-Cr-H-200X-06/7
R-Cr-H-200X-06/07
R-Cr-H-200X-08/9
R-Cr-H-200X-08/09
R-Cr-H-200X-10/11
R-Cr-H-200X-12/13
R-Cr-H-200X-14/15
R-C2-H-201X-00/01-sk
R-C2-H-201X-02/3-sk
R-C2-H-201X-02/03-sk
R-C2-H-201X-04/5-sk
R-C2-H-201X-04/05-sk
R-C2-H-201X-06/7-sk
R-C2-H-201X-06/07-sk
R-C2-H-201X-08/9-sk
R-C2-H-201X-08/09-sk
R-C2-H-201X-10/11-sk
R-C2-H-201X-12/13-sk
1 Ruder-ID S-C2-M-19XX-01-B/S
2 S-C2-H-201X-98-B-sk S-Sw-M-201X-01-B/S
3 S-C2-H-201X-97-B-sk S-Sw-M-201X-02-B/S
4 S-C2-H-201X-99-B-sk S-Sw-M-201X-03-B/S
5 S-C2-H-201X-96-B-sk S-Sw-M-201X-04-B/S
6 S-C2-H-201X-98-B-sk S-Cr-M-200X-01-B/S
7 S-C2-H-201X-97-B-sk S-Cr-M-200X-02-B/S
8 S-C2-H-201X-99-B-sk S-Cr-M-200X-03-B/S
9 S-C2-H-201X-96-B-sk S-Cr-M-200X-04-B/S
10 S-C2-H-201X-98-B-sk S-Cr-M-200X-05-B/S
11 S-C2-H-201X-97-B-sk S-Cr-M-200X-06-B/S
12 S-C2-H-201X-99-B-sk S-Cr-M-200X-07-B/S
13 S-C2-H-201X-96-B-sk S-Cr-M-200X-08-B/S
14 S-C2-H-201X-98-B-sk S-Cr-M-200X-09-B/S
15 S-C2-H-201X-97-B-sk S-Cr-M-200X-10-B/S
16 S-Cr-M-200X-11-B/S
17 S-Cr-H-200X-01-B/S
18 S-Cr-H-200X-02-B/S
19 S-Cr-H-200X-03-B/S
20 S-Cr-H-200X-04-B/S
21 S-Cr-H-200X-05-B/S
22 S-C2-H-201X-01-B/S
23 S-C2-H-201X-02-B/S
24 S-C2-H-201X-03-B/S
25 S-C2-H-201X-04-B/S
26 S-C2-H-201X-05-B/S
27 S-C2-H-201X-06-B/S
28 S-C2-H-201X-07-B/S
29 S-C2-H-201X-08-B/S
30 S-C2-H-201X-09-B/S
31 S-C2-H-201X-10-B/S
32 S-C2-H-201X-11-B/S
33 S-C2-H-201X-12-B/S
34 S-C2-H-201X-13-B/S
35 S-C2-H-201X-14-B/S
36 S-C2-H-201X-15-B/S
37 S-C2-H-201X-16-B/S
38 S-C2-H-201X-17-B/S
39 S-C2-H-201X-20-B/S-sk
40 S-C2-H-201X-21-B/S-sk
41 S-C2-H-201X-22-B/S-sk
42 S-C2-H-201X-23-B/S-sk
43 S-C2-H-201X-24-B/S-sk
44 S-C2-H-201X-25-B/S-sk
45 S-C2-H-201X-26-B/S-sk
46 S-C2-H-202X-01-B/S-sk
47 S-C2-H-202X-02-B/S-sk
48 S-C2-H-202X-03-B/S-sk
49 R-Em-H-19XX-00/01
50 R-Em-H-19XX-02/3
51 R-Em-H-19XX-02/03
52 R-Em-H-19XX-04/5
53 R-Em-H-19XX-04/05
54 R-Em-H-19XX-06/7
55 R-Em-H-19XX-06/07
56 R-Em-H-19XX-08/9
57 R-Cr-H-200X-00/01
58 R-Cr-H-200X-02/3
59 R-Cr-H-200X-02/03
60 R-Cr-H-200X-04/5
61 R-Cr-H-200X-04/05
62 R-Cr-H-200X-06/7
63 R-Cr-H-200X-06/07
64 R-Cr-H-200X-08/9
65 R-Cr-H-200X-08/09
66 R-Cr-H-200X-10/11
67 R-Cr-H-200X-12/13
68 R-Cr-H-200X-14/15
69 R-C2-H-201X-00/01-sk
70 R-C2-H-201X-02/3-sk
71 R-C2-H-201X-02/03-sk
72 R-C2-H-201X-04/5-sk
73 R-C2-H-201X-04/05-sk
74 R-C2-H-201X-06/7-sk
75 R-C2-H-201X-06/07-sk
76 R-C2-H-201X-08/9-sk
77 R-C2-H-201X-08/09-sk
78 R-C2-H-201X-10/11-sk
79 R-C2-H-201X-12/13-sk

Binary file not shown.

View File

@@ -20,8 +20,6 @@
\begin{document}
% \maketitle
\begin{center}
\begin{minipage}{0.9\textwidth}
\section*{Ruder ID Format}
@@ -64,11 +62,12 @@
& & & Em: & Empacher \\
& & & Sw: & Swift Racing \\
\midrule
\multirow{2}{*}{\textbf{S3}} &
\multirow{2}{*}{\textbf{Blatttyp}} &
\multirow{2}{*}{1}
\multirow{3}{*}{\textbf{S3}} &
\multirow{3}{*}{\textbf{Blatttyp}} &
\multirow{3}{*}{1}
& M: & Macon \\
& & & H: & Hacke \\
& & & C: & Comp \\
\midrule
\multirow{4}{*}{\textbf{S4}} &
\multirow{4}{*}{\textbf{Anschaffungsjahr}} &

Binary file not shown.

View File

@@ -25,7 +25,7 @@
"\n",
"\n",
"# Modern Nextcloud WebDAV endpoint format:\n",
"WEBDAV_BASE_URL = f\"{NEXTCLOUD_URL}/remote.php/dav/files/{USERNAME}/Shared/Ruderverein/Videoanalyse\""
"WEBDAV_BASE_URL = f\"{NEXTCLOUD_URL}/remote.php/dav/files/{USERNAME}/Shared/Ruderverein/02_Athlet:innen/01_Videoanalyse\""
]
},
{

View File

@@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": null,
"execution_count": 25,
"id": "f46948ac",
"metadata": {},
"outputs": [],
@@ -14,7 +14,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 26,
"id": "3a1de802",
"metadata": {},
"outputs": [],
@@ -28,14 +28,22 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 27,
"id": "1fdfef34",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"File loaded successfully!\n"
]
}
],
"source": [
"# read list of boats\n",
"\n",
"FILE_PATH = \"Shared/Ruderverein/Material/Bootsliste.xlsx\"\n",
"FILE_PATH = \"Shared/Ruderverein/01_Material/01_Bootsliste.xlsx\"\n",
"\n",
"# Build the WebDAV URL\n",
"# Note: Path should be URL-encoded if it contains spaces or special characters\n",
@@ -55,7 +63,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 28,
"id": "80f97e18",
"metadata": {},
"outputs": [],
@@ -80,7 +88,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 29,
"id": "70fb2327",
"metadata": {},
"outputs": [],
@@ -90,7 +98,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 30,
"id": "bf18a0fd",
"metadata": {},
"outputs": [],
@@ -99,45 +107,65 @@
"variants = []\n",
"places = []\n",
"\n",
"for boat_name in df['Name'].unique():\n",
" number_seats = df.loc[df['Name']==boat_name,'number_seats'].values[0]\n",
" variable = df.loc[df['Name']==boat_name,'variable'].values[0]\n",
"for boat_name in boats_df['Name'].unique():\n",
" number_seats = boats_df.loc[boats_df['Name']==boat_name,'number_seats'].values[0]\n",
" variable = boats_df.loc[boats_df['Name']==boat_name,'variable'].values[0]\n",
"\n",
" if bool(variable) is False:\n",
" for place in range(1,number_seats+1):\n",
" boat_names.append(boat_name)\n",
" boat_names.append(boat_name.strip())\n",
" variants.append(f\"{number_seats}x\")\n",
" places.append(place)\n",
" elif bool(variable) is True:\n",
" for place in range(1,number_seats+1):\n",
" boat_names.append(boat_name)\n",
" boat_names.append(boat_name.strip())\n",
" variants.append(f\"{number_seats}x\")\n",
" places.append(place)\n",
" for place in range(1,number_seats+1):\n",
" boat_names.append(boat_name)\n",
" boat_names.append(boat_name.strip())\n",
" variants.append(f\"{number_seats}-\")\n",
" places.append(place)"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 31,
"id": "85059518",
"metadata": {},
"outputs": [],
"source": [
"data_dict = {'Bootsname':boat_names,'Trimmung':variants,'Bootsplatz':places,'Ruder-ID':[None for _ in boat_names]}\n",
"data_dict = {'Bootsname':boat_names,'Trimmung':variants,'Bootsplatz':places,'Ruder-ID Macon':[None for _ in boat_names],'Ruder-ID Hacke':[None for _ in boat_names]}\n",
"places_df = pd.DataFrame(data_dict)"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 55,
"id": "7c4f5c01",
"metadata": {},
"outputs": [],
"source": [
"places_df['sort_value'] = places_df['Bootsname'].str.lower()"
]
},
{
"cell_type": "code",
"execution_count": 56,
"id": "edd22b3f",
"metadata": {},
"outputs": [],
"source": [
"places_df.sort_values(by='sort_value',inplace=True,ignore_index=True)"
]
},
{
"cell_type": "code",
"execution_count": 58,
"id": "3071bf52",
"metadata": {},
"outputs": [],
"source": [
"places_df.to_excel('temp.xlsx')"
"places_df[['Bootsname','Trimmung','Bootsplatz','Ruder-ID Macon','Ruder-ID Hacke']].to_excel('temp.xlsx')"
]
}
],

View File

@@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": null,
"execution_count": 9,
"id": "3a384a62",
"metadata": {},
"outputs": [],
@@ -15,7 +15,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 10,
"id": "05055b94",
"metadata": {},
"outputs": [],
@@ -29,14 +29,22 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 11,
"id": "13fb9852",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"File loaded successfully!\n"
]
}
],
"source": [
"# read list of boats\n",
"\n",
"FILE_PATH = \"Shared/Ruderverein/Material/Ruderliste.xlsx\"\n",
"FILE_PATH = \"Shared/Ruderverein/01_Material/02_Ruderliste.xlsx\"\n",
"\n",
"# Build the WebDAV URL\n",
"# Note: Path should be URL-encoded if it contains spaces or special characters\n",
@@ -47,7 +55,7 @@
"\n",
"if response.status_code == 200:\n",
" # Use BytesIO to turn the raw binary content into a file-like object\n",
" oars_df = pd.read_excel(BytesIO(response.content))\n",
" oars_df = pd.read_excel(BytesIO(response.content),sheet_name='Ruder')\n",
" print(\"File loaded successfully!\")\n",
"else:\n",
" print(f\"Failed to fetch file. Status code: {response.status_code}\")\n",
@@ -56,14 +64,59 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 12,
"id": "16e39eff",
"metadata": {},
"outputs": [],
"source": [
"printing_df = oars_df['Ruder-ID'].to_frame()"
]
},
{
"cell_type": "code",
"execution_count": 25,
"id": "28fcc50d",
"metadata": {},
"outputs": [],
"source": [
"def create_label_from_oar_id(row):\n",
" oar_id = row['Ruder-ID']\n",
"\n",
" parts = oar_id.split('-')\n",
" if parts[0] == 'S':\n",
" parts[5] = 'B/S'\n",
" elif parts[0] == 'R':\n",
" if int(parts[4])%2 == 0:\n",
" parts[4] = parts[4] +'/' f'{int(parts[4])+1}'.zfill(2)\n",
" else:\n",
" parts[4] = f'{int(parts[4])-1}'.zfill(2)+'/'+parts[4]\n",
" parts.remove(parts[5])\n",
"\n",
"\n",
" return '-'.join(parts)"
]
},
{
"cell_type": "code",
"execution_count": 26,
"id": "e3992d5c",
"metadata": {},
"outputs": [],
"source": [
"printing_df['label']=printing_df.apply(create_label_from_oar_id,axis=1)"
]
},
{
"cell_type": "code",
"execution_count": 28,
"id": "d6394323",
"metadata": {},
"outputs": [],
"source": [
"parent_folder = os.path.dirname(os.getcwd())\n",
"target_path = os.path.join(parent_folder,'LaTex','Ruder-IDs.csv')\n",
"oars_df['Ruder-ID'].to_csv(target_path,index=False)"
"export_df = printing_df.drop_duplicates(subset='label')\n",
"export_df['label'].to_csv(target_path,index=False,header=False)"
]
}
],

View File

@@ -0,0 +1,423 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 40,
"id": "3a384a62",
"metadata": {},
"outputs": [],
"source": [
"import requests\n",
"import pandas as pd\n",
"from io import BytesIO\n",
"import os\n",
"import numpy as np"
]
},
{
"cell_type": "code",
"execution_count": 41,
"id": "05055b94",
"metadata": {},
"outputs": [],
"source": [
"# --- Configuration ---\n",
"NEXTCLOUD_URL = \"https://nextcloud.karnelegger.eu\"\n",
"USERNAME = \"Georg Brantegger\"\n",
"with open('app_pw.txt','r') as f:\n",
" APP_PASSWORD = f.readline()\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "13fb9852",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"File loaded successfully!\n",
"File loaded successfully!\n"
]
}
],
"source": [
"# read list of boats\n",
"\n",
"FILE_PATH_1 = \"Shared/Ruderverein/01_Material/02_Ruderliste.xlsx\"\n",
"\n",
"# Build the WebDAV URL\n",
"# Note: Path should be URL-encoded if it contains spaces or special characters\n",
"webdav_url = f\"{NEXTCLOUD_URL}/remote.php/dav/files/{USERNAME}/{FILE_PATH_1}\"\n",
"\n",
"# --- The Request ---\n",
"response = requests.get(webdav_url, auth=(USERNAME, APP_PASSWORD))\n",
"\n",
"if response.status_code == 200:\n",
" # Use BytesIO to turn the raw binary content into a file-like object\n",
" oars_df = pd.read_excel(BytesIO(response.content),sheet_name='Ruder',index_col=0)\n",
" print(\"File loaded successfully!\")\n",
"else:\n",
" print(f\"Failed to fetch file. Status code: {response.status_code}\")\n",
" print(response.text)\n",
"\n",
"FILE_PATH_2 = \"Shared/Ruderverein/01_Material/03_Bootsplatz-Ruder-Zuordnung.xlsx\"\n",
"\n",
"# Build the WebDAV URL\n",
"# Note: Path should be URL-encoded if it contains spaces or special characters\n",
"webdav_url = f\"{NEXTCLOUD_URL}/remote.php/dav/files/{USERNAME}/{FILE_PATH_2}\"\n",
"\n",
"# --- The Request ---\n",
"response = requests.get(webdav_url, auth=(USERNAME, APP_PASSWORD))\n",
"\n",
"if response.status_code == 200:\n",
" # Use BytesIO to turn the raw binary content into a file-like object\n",
" places_df = pd.read_excel(BytesIO(response.content),sheet_name='Bootsplatz_Zuordnung').fillna('')\n",
" print(\"File loaded successfully!\")\n",
"else:\n",
" print(f\"Failed to fetch file. Status code: {response.status_code}\")\n",
" print(response.text)\n",
" "
]
},
{
"cell_type": "code",
"execution_count": 43,
"id": "16e39eff",
"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>Länge Ruder gesamt</th>\n",
" <th>Länge Innenhebel</th>\n",
" <th>Anlage</th>\n",
" <th>Länge Ruder min</th>\n",
" <th>Länge Ruder max</th>\n",
" <th>Skinny Typ</th>\n",
" <th>Bootsplatz 1</th>\n",
" <th>Bootsplatz 2</th>\n",
" <th>Bootsplatz 3</th>\n",
" </tr>\n",
" <tr>\n",
" <th>Ruder-ID</th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></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>R-C2-H-201X-01-S-sk</th>\n",
" <td>370.5</td>\n",
" <td>111.0</td>\n",
" <td>+1</td>\n",
" <td>370.0</td>\n",
" <td>375.0</td>\n",
" <td>MEDFLEX</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>R-C2-H-201X-02-B-sk</th>\n",
" <td>370.0</td>\n",
" <td>111.0</td>\n",
" <td>-3,5</td>\n",
" <td>370.0</td>\n",
" <td>375.0</td>\n",
" <td>MEDFLEX</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>R-C2-H-201X-03-S-sk</th>\n",
" <td>370.5</td>\n",
" <td>111.5</td>\n",
" <td>+1</td>\n",
" <td>370.0</td>\n",
" <td>375.0</td>\n",
" <td>MEDFLEX</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>R-C2-H-201X-04-B-sk</th>\n",
" <td>370.0</td>\n",
" <td>111.5</td>\n",
" <td>-2</td>\n",
" <td>370.0</td>\n",
" <td>375.0</td>\n",
" <td>MEDFLEX</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>R-C2-H-201X-05-S-sk</th>\n",
" <td>374.7</td>\n",
" <td>115.0</td>\n",
" <td>+2</td>\n",
" <td>373.0</td>\n",
" <td>378.0</td>\n",
" <td>MEDFLEX</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</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",
" </tr>\n",
" <tr>\n",
" <th>S-Sw-M-201X-02-S</th>\n",
" <td>294.0</td>\n",
" <td>88.0</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>S-Sw-M-201X-03-B</th>\n",
" <td>294.0</td>\n",
" <td>88.0</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>S-Sw-M-201X-03-S</th>\n",
" <td>294.0</td>\n",
" <td>88.0</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>S-Sw-M-201X-04-B</th>\n",
" <td>294.0</td>\n",
" <td>88.0</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>S-Sw-M-201X-04-S</th>\n",
" <td>294.0</td>\n",
" <td>88.0</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>134 rows × 9 columns</p>\n",
"</div>"
],
"text/plain": [
" Länge Ruder gesamt Länge Innenhebel Anlage \\\n",
"Ruder-ID \n",
"R-C2-H-201X-01-S-sk 370.5 111.0 +1 \n",
"R-C2-H-201X-02-B-sk 370.0 111.0 -3,5 \n",
"R-C2-H-201X-03-S-sk 370.5 111.5 +1 \n",
"R-C2-H-201X-04-B-sk 370.0 111.5 -2 \n",
"R-C2-H-201X-05-S-sk 374.7 115.0 +2 \n",
"... ... ... ... \n",
"S-Sw-M-201X-02-S 294.0 88.0 NaN \n",
"S-Sw-M-201X-03-B 294.0 88.0 NaN \n",
"S-Sw-M-201X-03-S 294.0 88.0 NaN \n",
"S-Sw-M-201X-04-B 294.0 88.0 NaN \n",
"S-Sw-M-201X-04-S 294.0 88.0 NaN \n",
"\n",
" Länge Ruder min Länge Ruder max Skinny Typ \\\n",
"Ruder-ID \n",
"R-C2-H-201X-01-S-sk 370.0 375.0 MEDFLEX \n",
"R-C2-H-201X-02-B-sk 370.0 375.0 MEDFLEX \n",
"R-C2-H-201X-03-S-sk 370.0 375.0 MEDFLEX \n",
"R-C2-H-201X-04-B-sk 370.0 375.0 MEDFLEX \n",
"R-C2-H-201X-05-S-sk 373.0 378.0 MEDFLEX \n",
"... ... ... ... \n",
"S-Sw-M-201X-02-S NaN NaN NaN \n",
"S-Sw-M-201X-03-B NaN NaN NaN \n",
"S-Sw-M-201X-03-S NaN NaN NaN \n",
"S-Sw-M-201X-04-B NaN NaN NaN \n",
"S-Sw-M-201X-04-S NaN NaN NaN \n",
"\n",
" Bootsplatz 1 Bootsplatz 2 Bootsplatz 3 \n",
"Ruder-ID \n",
"R-C2-H-201X-01-S-sk NaN NaN NaN \n",
"R-C2-H-201X-02-B-sk NaN NaN NaN \n",
"R-C2-H-201X-03-S-sk NaN NaN NaN \n",
"R-C2-H-201X-04-B-sk NaN NaN NaN \n",
"R-C2-H-201X-05-S-sk NaN NaN NaN \n",
"... ... ... ... \n",
"S-Sw-M-201X-02-S NaN NaN NaN \n",
"S-Sw-M-201X-03-B NaN NaN NaN \n",
"S-Sw-M-201X-03-S NaN NaN NaN \n",
"S-Sw-M-201X-04-B NaN NaN NaN \n",
"S-Sw-M-201X-04-S NaN NaN NaN \n",
"\n",
"[134 rows x 9 columns]"
]
},
"execution_count": 43,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"oars_df"
]
},
{
"cell_type": "code",
"execution_count": 44,
"id": "da9397a8",
"metadata": {},
"outputs": [],
"source": [
"places_df['Bootsplatz-Label'] = places_df.apply(lambda row: '_'.join(row[['Bootsname','Trimmung','Bootsplatz']].astype(str).to_list()),axis=1)"
]
},
{
"cell_type": "code",
"execution_count": 45,
"id": "43ffb028",
"metadata": {},
"outputs": [],
"source": [
"my_dict = {key:[] for key in oars_df.index.values}\n",
"\n",
"\n",
"for oar_id in my_dict.keys():\n",
" relevant_part = '-'.join(oar_id.split('-')[:5])\n",
"\n",
" for i,row in places_df.iterrows():\n",
" test_macon = '-'.join(row['Ruder-ID Macon'].split('-')[:5])\n",
" test_hacke = '-'.join(row['Ruder-ID Hacke'].split('-')[:5])\n",
" if (relevant_part == test_macon ) | (relevant_part == test_hacke):\n",
" my_dict[oar_id].append(row['Bootsplatz-Label'])\n"
]
},
{
"cell_type": "code",
"execution_count": 46,
"id": "0b3f5068",
"metadata": {},
"outputs": [],
"source": [
"for oar_id in my_dict.keys():\n",
" places_list = np.array(my_dict[oar_id])\n",
" boat_sizes = [place_label.split('_')[1][0] if len(place_label)>0 else '' for place_label in places_list]\n",
" my_dict[oar_id] = np.flip(places_list[np.argsort(np.array(boat_sizes))])"
]
},
{
"cell_type": "code",
"execution_count": 47,
"id": "3a7eb82e",
"metadata": {},
"outputs": [],
"source": [
"my_df = pd.DataFrame.from_dict(my_dict, orient='index',columns=['Bootsplatz 1','Bootsplatz 2','Bootsplatz 3'])"
]
},
{
"cell_type": "code",
"execution_count": 48,
"id": "d85765c4",
"metadata": {},
"outputs": [],
"source": [
"oars_df[['Bootsplatz 1','Bootsplatz 2','Bootsplatz 3']] = my_df[['Bootsplatz 1','Bootsplatz 2','Bootsplatz 3']]"
]
},
{
"cell_type": "code",
"execution_count": 52,
"id": "b6848ae9",
"metadata": {},
"outputs": [],
"source": [
"oars_df.to_csv('temp.csv',index=True,sep=';',decimal=',')"
]
}
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"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.12.3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}