{ "cells": [ { "cell_type": "markdown", "id": "64b940eb", "metadata": {}, "source": [ "# Tutorial 54: Measured Variable Tables" ] }, { "cell_type": "markdown", "id": "49e1a79a", "metadata": {}, "source": [ "This example demonstrates how view, create, delete and edit measured variable tables (Sollwerttabellen) with pandas dataframes as python representation." ] }, { "cell_type": "markdown", "id": "504515b8", "metadata": {}, "source": [ "# SIR 3S Installation" ] }, { "cell_type": "code", "execution_count": 1, "id": "40385647", "metadata": {}, "outputs": [], "source": [ "SIR3S_SIRGRAF_DIR = r\"C:\\3S\\SIR 3S\\SirGraf-90-15-00-24_Quebec-Upd2\" #change to local path" ] }, { "cell_type": "markdown", "id": "c757fe00", "metadata": {}, "source": [ "# Imports" ] }, { "cell_type": "code", "execution_count": 2, "id": "9cba6ba7", "metadata": {}, "outputs": [], "source": [ "from sir3stoolkit.core import wrapper" ] }, { "cell_type": "code", "execution_count": 3, "id": "fd6e5884", "metadata": {}, "outputs": [], "source": [ "from sir3stoolkit.mantle import mantle" ] }, { "cell_type": "markdown", "id": "a9371df0", "metadata": {}, "source": [ "The wrapper package has to be initialized with reference to a SIR 3S (SirGraf) installation." ] }, { "cell_type": "code", "execution_count": 4, "id": "f94d378e", "metadata": {}, "outputs": [], "source": [ "wrapper.Initialize_Toolkit(SIR3S_SIRGRAF_DIR)" ] }, { "cell_type": "markdown", "id": "0e204663", "metadata": {}, "source": [ "## Additional imports" ] }, { "cell_type": "code", "execution_count": 5, "id": "1b333711", "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "import numpy as np\n", "import pandas as pd\n", "import numpy as np\n", "from datetime import datetime, timedelta" ] }, { "cell_type": "markdown", "id": "82e3dfe1", "metadata": {}, "source": [ "..." ] }, { "cell_type": "markdown", "id": "5da56a4a", "metadata": {}, "source": [ "# Initialization" ] }, { "cell_type": "code", "execution_count": 6, "id": "f8ac374b", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Initialization complete\n" ] } ], "source": [ "s3s = mantle.SIR3S_Model_Mantle()" ] }, { "cell_type": "code", "execution_count": 7, "id": "3841073e", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Initialization complete\n" ] } ], "source": [ "from sir3stoolkit.mantle import dataframes\n", "s3s = dataframes.SIR3S_Model_Dataframes()" ] }, { "cell_type": "markdown", "id": "f1c7cb13", "metadata": {}, "source": [ "# Open Model" ] }, { "cell_type": "code", "execution_count": 8, "id": "be97ac21", "metadata": {}, "outputs": [], "source": [ "dbFilePath=r\"Toolkit_Tutorial54_Model.db3\"" ] }, { "cell_type": "code", "execution_count": 9, "id": "552a4b09", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Model is open for further operation\n" ] } ], "source": [ "s3s.OpenModel(dbName=dbFilePath,\n", " providerType=s3s.ProviderTypes.SQLite,\n", " Mid=\"M-1-0-1\",\n", " saveCurrentlyOpenModel=False,\n", " namedInstance=\"\",\n", " userID=\"\",\n", " password=\"\")" ] }, { "cell_type": "markdown", "id": "b06c08f2", "metadata": {}, "source": [ "# Create new measured variable tables" ] }, { "cell_type": "markdown", "id": "7d8fec3e", "metadata": {}, "source": [ "Let's insert Variable 1 as a placeholder example." ] }, { "cell_type": "code", "execution_count": 10, "id": "286f771e", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['Name',\n", " 'Beschreibung',\n", " 'Zeitoption',\n", " 'Intpol',\n", " 'Idreferenz',\n", " 'Pk',\n", " 'InVariant']" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "s3s.GetPropertiesofElementType(ElementType=s3s.ObjectTypes.MeasuredVariableTable)" ] }, { "cell_type": "code", "execution_count": 11, "id": "404a2856", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Element inserted successfully into the model with Tk: 5106786640761474739\n" ] } ], "source": [ "measured_variable_table_1 = s3s.InsertElement(ElementType=s3s.ObjectTypes.MeasuredVariableTable, IdRef=\"1\")" ] }, { "cell_type": "code", "execution_count": 12, "id": "97e265ba", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Value is set\n" ] } ], "source": [ "s3s.SetValue(Tk=measured_variable_table_1, propertyName=\"Name\", Value=\"Variable 1\")" ] }, { "cell_type": "code", "execution_count": 13, "id": "a32ee4c9", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Value is set\n" ] } ], "source": [ "s3s.SetValue(Tk=measured_variable_table_1, propertyName=\"Zeitoption\", Value=\"0\") # We do not want special time reference, see general SIR 3S documentation for details" ] }, { "cell_type": "code", "execution_count": 14, "id": "f8aa8346", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Value is set\n" ] } ], "source": [ "s3s.SetValue(Tk=measured_variable_table_1, propertyName=\"Intpol\", Value=\"0\") # We choose linear interpolation scheme. Use 9 for step function" ] }, { "cell_type": "markdown", "id": "42791036", "metadata": {}, "source": [ "## Insert values" ] }, { "cell_type": "markdown", "id": "2f79357d", "metadata": {}, "source": [ "W is the value that is given as a function of time W = f(t)" ] }, { "cell_type": "markdown", "id": "b77cdd98", "metadata": {}, "source": [ "The sample data we provide is in 'measured' in constant time intervals and the values are random between 0 and 100." ] }, { "cell_type": "code", "execution_count": 15, "id": "f7cae338", "metadata": {}, "outputs": [], "source": [ "# Create time vector: 0 to 600 seconds, step 20\n", "time_seconds = np.arange(0, 601, 20)\n", "\n", "# Create variable values between 0 and 100\n", "np.random.seed(42)\n", "werte = np.random.rand(len(time_seconds)) * 100\n", "\n", "YEAR = 2026\n", "DATE = datetime(YEAR, 1, 1) # constant date for all entries\n", "\n", "rows = []\n", "\n", "for t, w in zip(time_seconds, werte):\n", " timestamp = DATE + timedelta(seconds=int(t))\n", " tag = timestamp.strftime(\"%Y-%m-%d\")\n", " uhrzeit = timestamp.strftime(\"%H:%M:%S.%f\")\n", "\n", " rows.append({\n", " \"TAG\": tag,\n", " \"UHRZEIT\": uhrzeit,\n", " \"WERT\": w\n", " })\n", "\n", "# Build DataFrame\n", "df = pd.DataFrame(rows, columns=[\"TAG\", \"UHRZEIT\", \"WERT\"])" ] }, { "cell_type": "code", "execution_count": 16, "id": "2c91a9ff", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
TAGUHRZEITWERT
02026-01-0100:00:00.00000037.454012
12026-01-0100:00:20.00000095.071431
22026-01-0100:00:40.00000073.199394
\n", "
" ], "text/plain": [ " TAG UHRZEIT WERT\n", "0 2026-01-01 00:00:00.000000 37.454012\n", "1 2026-01-01 00:00:20.000000 95.071431\n", "2 2026-01-01 00:00:40.000000 73.199394" ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.head(3)" ] }, { "cell_type": "markdown", "id": "70396c52", "metadata": {}, "source": [ "We can use the [insert_dataframe_into_time_table()](https://3sconsult.github.io/sir3stoolkit/references/sir3stoolkit.mantle.html#sir3stoolkit.mantle.advanced_operations.SIR3S_Model_Advanced_Operations.insert_dataframe_into_time_table) method to insert the dataframe into the model as a measured variable table." ] }, { "cell_type": "code", "execution_count": 17, "id": "fce3d130", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "[2026-03-15 23:21:45,909] INFO in sir3stoolkit.mantle.dataframes: [insert dataframe into time table] Validating input data ...\n", "[2026-03-15 23:21:46,062] INFO in sir3stoolkit.mantle.dataframes: [insert dataframe into time table] Successfully validated input data.\n", "[2026-03-15 23:21:46,064] INFO in sir3stoolkit.mantle.dataframes: [insert dataframe into time table] Deleting previous table rows ...\n", "[2026-03-15 23:21:46,088] INFO in sir3stoolkit.mantle.dataframes: [insert dataframe into time table] Inserting value pairs ...\n", "[2026-03-15 23:21:46,150] INFO in sir3stoolkit.mantle.dataframes: [insert dataframe into time table] Successfully inserted value pairs\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Row is added to the table with Tk: 5511155235703596569\n", "Value is set\n", "Value is set\n", "Row is added to the table with Tk: 4825162945970759077\n", "Value is set\n", "Value is set\n", "Row is added to the table with Tk: 5521553334084544950\n", "Value is set\n", "Value is set\n", "Row is added to the table with Tk: 5525861603483762389\n", "Value is set\n", "Value is set\n", "Row is added to the table with Tk: 4781997243709936648\n", "Value is set\n", "Value is set\n", "Row is added to the table with Tk: 5156056649568580716\n", "Value is set\n", "Value is set\n", "Row is added to the table with Tk: 4879667976440342748\n", "Value is set\n", "Value is set\n", "Row is added to the table with Tk: 5757735004081879745\n", "Value is set\n", "Value is set\n", "Row is added to the table with Tk: 5270771206606675534\n", "Value is set\n", "Value is set\n", "Row is added to the table with Tk: 5356156136750266123\n", "Value is set\n", "Value is set\n", "Row is added to the table with Tk: 5274865376625650628\n", "Value is set\n", "Value is set\n", "Row is added to the table with Tk: 5643180560610670472\n", "Value is set\n", "Value is set\n", "Row is added to the table with Tk: 4735710860099421525\n", "Value is set\n", "Value is set\n", "Row is added to the table with Tk: 5242751510991005820\n", "Value is set\n", "Value is set\n", "Row is added to the table with Tk: 5059165236983414066\n", "Value is set\n", "Value is set\n", "Row is added to the table with Tk: 5207350801417098632\n", "Value is set\n", "Value is set\n", "Row is added to the table with Tk: 5620761669190564881\n", "Value is set\n", "Value is set\n", "Row is added to the table with Tk: 5398755750928181747\n", "Value is set\n", "Value is set\n", "Row is added to the table with Tk: 5468273030384953951\n", "Value is set\n", "Value is set\n", "Row is added to the table with Tk: 5378449128804989150\n", "Value is set\n", "Value is set\n", "Row is added to the table with Tk: 4892813647782580457\n", "Value is set\n", "Value is set\n", "Row is added to the table with Tk: 5386302469724656505\n", "Value is set\n", "Value is set\n", "Row is added to the table with Tk: 4835333517786276925\n", "Value is set\n", "Value is set\n", "Row is added to the table with Tk: 4912022863985683158\n", "Value is set\n", "Value is set\n", "Row is added to the table with Tk: 5216101434651515658\n", "Value is set\n", "Value is set\n", "Row is added to the table with Tk: 5106335853962282844\n", "Value is set\n", "Value is set\n", "Row is added to the table with Tk: 5496823346782345808\n", "Value is set\n", "Value is set\n", "Row is added to the table with Tk: 5418828972356076760\n", "Value is set\n", "Value is set\n", "Row is added to the table with Tk: 4956836853293904667\n", "Value is set\n", "Value is set\n", "Row is added to the table with Tk: 4655372675412091100\n", "Value is set\n", "Value is set\n", "Row is added to the table with Tk: 5582807784106464947\n", "Value is set\n", "Value is set\n" ] } ], "source": [ "s3s.insert_dataframe_into_time_table(time_table_tk=measured_variable_table_1, dataframe=df)" ] }, { "cell_type": "markdown", "id": "73b86694", "metadata": {}, "source": [ "# View measured value tables" ] }, { "cell_type": "code", "execution_count": 18, "id": "7bd5363d", "metadata": {}, "outputs": [], "source": [ "def view_non_value_data_of_measured_variable_table(measured_variable_table_tk):\n", " name = s3s.GetValue(Tk=measured_variable_table_tk, propertyName=\"Name\")[0]\n", " intpol = s3s.GetValue(Tk=measured_variable_table_tk, propertyName=\"Intpol\")[0]\n", " if intpol == \"0\":\n", " intpol_clear = \"linear\"\n", " elif intpol == \"9\":\n", " intpol_clear = \"step function\"\n", " else:\n", " intpol_clear = \"invalid intpol\"\n", " print(f\"Tk: {measured_variable_table_tk}, Name: {name}, Interpolation scheme: {intpol_clear}\")" ] }, { "cell_type": "markdown", "id": "dcf6f060", "metadata": {}, "source": [ "We can use the [get_dataframes_from_time_table_type()](https://3sconsult.github.io/sir3stoolkit/references/sir3stoolkit.mantle.html#sir3stoolkit.mantle.advanced_operations.SIR3S_Model_Advanced_Operations.get_dataframes_from_time_table_type) method to obtain a df containing all dfs of a certain time table type (eg. MeasuredVariableTable), a dict with all individual dfs and their tk keys." ] }, { "cell_type": "code", "execution_count": 19, "id": "331dcfac", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "[2026-03-15 23:21:46,191] INFO in sir3stoolkit.mantle.dataframes: [get dataframes from time table type] ...\n", "[2026-03-15 23:21:46,195] INFO in sir3stoolkit.mantle.dataframes: [get dataframe from time table] Validating input data (time_table_tk=4690496339163833971)...\n", "[2026-03-15 23:21:46,201] INFO in sir3stoolkit.mantle.dataframes: [get dataframe from time table] Successfully validated input data.\n", "[2026-03-15 23:21:46,203] INFO in sir3stoolkit.mantle.dataframes: [get dataframe from time table] Building dataframe ...\n", "[2026-03-15 23:21:46,223] INFO in sir3stoolkit.mantle.dataframes: [get dataframe from time table] Successfully built dataframe.\n", "[2026-03-15 23:21:46,224] INFO in sir3stoolkit.mantle.dataframes: [get dataframe from time table] Validating input data (time_table_tk=4775965132419647289)...\n", "[2026-03-15 23:21:46,227] INFO in sir3stoolkit.mantle.dataframes: [get dataframe from time table] Successfully validated input data.\n", "[2026-03-15 23:21:46,228] INFO in sir3stoolkit.mantle.dataframes: [get dataframe from time table] Building dataframe ...\n", "[2026-03-15 23:21:46,232] INFO in sir3stoolkit.mantle.dataframes: [get dataframe from time table] Successfully built dataframe.\n", "[2026-03-15 23:21:46,233] INFO in sir3stoolkit.mantle.dataframes: [get dataframe from time table] Validating input data (time_table_tk=5721839716933060230)...\n", "[2026-03-15 23:21:46,234] INFO in sir3stoolkit.mantle.dataframes: [get dataframe from time table] Successfully validated input data.\n", "[2026-03-15 23:21:46,234] INFO in sir3stoolkit.mantle.dataframes: [get dataframe from time table] Building dataframe ...\n", "[2026-03-15 23:21:46,242] INFO in sir3stoolkit.mantle.dataframes: [get dataframe from time table] Successfully built dataframe.\n", "[2026-03-15 23:21:46,250] INFO in sir3stoolkit.mantle.dataframes: [get dataframe from time table] Validating input data (time_table_tk=5106786640761474739)...\n", "[2026-03-15 23:21:46,255] INFO in sir3stoolkit.mantle.dataframes: [get dataframe from time table] Successfully validated input data.\n", "[2026-03-15 23:21:46,256] INFO in sir3stoolkit.mantle.dataframes: [get dataframe from time table] Building dataframe ...\n", "[2026-03-15 23:21:46,264] INFO in sir3stoolkit.mantle.dataframes: [get dataframe from time table] Successfully built dataframe.\n", "[2026-03-15 23:21:46,273] INFO in sir3stoolkit.mantle.dataframes: [get dataframes from time table type] Successful\n" ] } ], "source": [ "df_h, table_dfs, table_tks = s3s.get_dataframes_from_time_table_type(\"MeasuredVariableTable\")" ] }, { "cell_type": "markdown", "id": "29d86e9c", "metadata": {}, "source": [ "## 0" ] }, { "cell_type": "code", "execution_count": 20, "id": "166ad160", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Variable 2
Zeit [s]
0.00.0
18.01.0
22.00.0
\n", "
" ], "text/plain": [ " Variable 2\n", "Zeit [s] \n", "0.0 0.0\n", "18.0 1.0\n", "22.0 0.0" ] }, "execution_count": 20, "metadata": {}, "output_type": "execute_result" } ], "source": [ "table_dfs[table_tks[0]].head(3)" ] }, { "cell_type": "code", "execution_count": 21, "id": "e191f2a2", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Tk: 4690496339163833971, Name: Variable 2, Interpolation scheme: step function\n" ] } ], "source": [ "view_non_value_data_of_measured_variable_table(table_tks[0])" ] }, { "cell_type": "markdown", "id": "6790787b", "metadata": {}, "source": [ "## 1" ] }, { "cell_type": "code", "execution_count": 22, "id": "a5d519fe", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Variable 2
Zeit [s]
0.099999.0
1.099999.0
\n", "
" ], "text/plain": [ " Variable 2\n", "Zeit [s] \n", "0.0 99999.0\n", "1.0 99999.0" ] }, "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "source": [ "table_dfs[table_tks[1]].head(3)" ] }, { "cell_type": "markdown", "id": "8b6bd42e", "metadata": {}, "source": [ "As can be seen this is some invalid duplicate, that can be deleted." ] }, { "cell_type": "code", "execution_count": 23, "id": "838d0103", "metadata": {}, "outputs": [], "source": [ "table_tk_to_delete = table_tks[1]" ] }, { "cell_type": "markdown", "id": "8c24d62a", "metadata": {}, "source": [ "## 2" ] }, { "cell_type": "code", "execution_count": 24, "id": "7596d1a0", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Variable 3
Zeit [s]
0.01.0
20.035.0
40.057.0
\n", "
" ], "text/plain": [ " Variable 3\n", "Zeit [s] \n", "0.0 1.0\n", "20.0 35.0\n", "40.0 57.0" ] }, "execution_count": 24, "metadata": {}, "output_type": "execute_result" } ], "source": [ "table_dfs[table_tks[2]].head(3)" ] }, { "cell_type": "code", "execution_count": 25, "id": "3d65bf6e", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Tk: 5721839716933060230, Name: Variable 3, Interpolation scheme: linear\n" ] } ], "source": [ "view_non_value_data_of_measured_variable_table(table_tks[2])" ] }, { "cell_type": "markdown", "id": "10fbdd91", "metadata": {}, "source": [ "## 3" ] }, { "cell_type": "code", "execution_count": 26, "id": "c630b992", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Variable 1
Zeit [s]
0.037.45401
20.095.07143
40.073.19939
\n", "
" ], "text/plain": [ " Variable 1\n", "Zeit [s] \n", "0.0 37.45401\n", "20.0 95.07143\n", "40.0 73.19939" ] }, "execution_count": 26, "metadata": {}, "output_type": "execute_result" } ], "source": [ "table_dfs[table_tks[3]].head(3)" ] }, { "cell_type": "code", "execution_count": 27, "id": "cfb637f6", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Tk: 5106786640761474739, Name: Variable 1, Interpolation scheme: linear\n" ] } ], "source": [ "view_non_value_data_of_measured_variable_table(table_tks[3])" ] }, { "cell_type": "markdown", "id": "edf77823", "metadata": {}, "source": [ "This is the table we created earlier, as can be seen, it worked out fine." ] }, { "cell_type": "markdown", "id": "0878088f", "metadata": {}, "source": [ "# Delete measured variable table" ] }, { "cell_type": "markdown", "id": "7933bb18", "metadata": {}, "source": [ "We can delete the faulty duplicate measured variable table as any other element. The rows depending on it will be deleted as well." ] }, { "cell_type": "code", "execution_count": 28, "id": "58b29d8e", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Element deleted successfully\n" ] } ], "source": [ "s3s.DeleteElement(Tk=str(table_tk_to_delete))" ] }, { "cell_type": "code", "execution_count": 29, "id": "14107c7f", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "[2026-03-15 23:21:46,555] INFO in sir3stoolkit.mantle.dataframes: [get dataframes from time table type] ...\n", "[2026-03-15 23:21:46,560] INFO in sir3stoolkit.mantle.dataframes: [get dataframe from time table] Validating input data (time_table_tk=4690496339163833971)...\n", "[2026-03-15 23:21:46,563] INFO in sir3stoolkit.mantle.dataframes: [get dataframe from time table] Successfully validated input data.\n", "[2026-03-15 23:21:46,565] INFO in sir3stoolkit.mantle.dataframes: [get dataframe from time table] Building dataframe ...\n", "[2026-03-15 23:21:46,583] INFO in sir3stoolkit.mantle.dataframes: [get dataframe from time table] Successfully built dataframe.\n", "[2026-03-15 23:21:46,584] INFO in sir3stoolkit.mantle.dataframes: [get dataframe from time table] Validating input data (time_table_tk=5721839716933060230)...\n", "[2026-03-15 23:21:46,591] INFO in sir3stoolkit.mantle.dataframes: [get dataframe from time table] Successfully validated input data.\n", "[2026-03-15 23:21:46,593] INFO in sir3stoolkit.mantle.dataframes: [get dataframe from time table] Building dataframe ...\n", "[2026-03-15 23:21:46,606] INFO in sir3stoolkit.mantle.dataframes: [get dataframe from time table] Successfully built dataframe.\n", "[2026-03-15 23:21:46,608] INFO in sir3stoolkit.mantle.dataframes: [get dataframe from time table] Validating input data (time_table_tk=5106786640761474739)...\n", "[2026-03-15 23:21:46,612] INFO in sir3stoolkit.mantle.dataframes: [get dataframe from time table] Successfully validated input data.\n", "[2026-03-15 23:21:46,613] INFO in sir3stoolkit.mantle.dataframes: [get dataframe from time table] Building dataframe ...\n", "[2026-03-15 23:21:46,624] INFO in sir3stoolkit.mantle.dataframes: [get dataframe from time table] Successfully built dataframe.\n", "[2026-03-15 23:21:46,628] INFO in sir3stoolkit.mantle.dataframes: [get dataframes from time table type] Successful\n" ] } ], "source": [ "df_h, table_dfs, table_tks = s3s.get_dataframes_from_time_table_type(\"MeasuredVariableTable\")" ] }, { "cell_type": "code", "execution_count": 30, "id": "ef4114e6", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "3" ] }, "execution_count": 30, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(table_dfs)" ] }, { "cell_type": "markdown", "id": "1f76372e", "metadata": {}, "source": [ "# Joint view" ] }, { "cell_type": "code", "execution_count": 31, "id": "d94eb9f9", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Variable 2Variable 3Variable 1
Zeit [s]
0.00.01.037.45401
18.01.0NaNNaN
20.0NaN35.095.07143
22.00.0NaNNaN
39.01.0NaNNaN
40.0NaN57.073.19939
52.00.0NaNNaN
60.0NaN40.059.86585
62.01.0NaNNaN
64.00.0NaNNaN
\n", "
" ], "text/plain": [ " Variable 2 Variable 3 Variable 1\n", "Zeit [s] \n", "0.0 0.0 1.0 37.45401\n", "18.0 1.0 NaN NaN\n", "20.0 NaN 35.0 95.07143\n", "22.0 0.0 NaN NaN\n", "39.0 1.0 NaN NaN\n", "40.0 NaN 57.0 73.19939\n", "52.0 0.0 NaN NaN\n", "60.0 NaN 40.0 59.86585\n", "62.0 1.0 NaN NaN\n", "64.0 0.0 NaN NaN" ] }, "execution_count": 31, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_h.head(10) " ] }, { "cell_type": "code", "execution_count": 32, "id": "b5bf9515", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 32, "metadata": {}, "output_type": "execute_result" } ], "source": [ "s3s.CloseModel(False)" ] } ], "metadata": { "kernelspec": { "display_name": "base", "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.8" } }, "nbformat": 4, "nbformat_minor": 5 }