You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
142 lines
6.0 KiB
Plaintext
142 lines
6.0 KiB
Plaintext
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "markdown",
|
|
"id": "dfef53e3-d4bc-4925-b907-d166f8ca3dad",
|
|
"metadata": {},
|
|
"source": [
|
|
"# Experimental Data-Analysis "
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 3,
|
|
"id": "8742325a",
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"Collecting pandas\n",
|
|
" Downloading pandas-2.3.3-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.metadata (91 kB)\n",
|
|
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m91.2/91.2 kB\u001b[0m \u001b[31m4.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
|
"\u001b[?25hCollecting numpy>=1.26.0 (from pandas)\n",
|
|
" Downloading numpy-2.3.3-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.metadata (62 kB)\n",
|
|
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m62.1/62.1 kB\u001b[0m \u001b[31m5.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
|
"\u001b[?25hRequirement already satisfied: python-dateutil>=2.8.2 in ./.venv/lib/python3.12/site-packages (from pandas) (2.9.0.post0)\n",
|
|
"Collecting pytz>=2020.1 (from pandas)\n",
|
|
" Using cached pytz-2025.2-py2.py3-none-any.whl.metadata (22 kB)\n",
|
|
"Collecting tzdata>=2022.7 (from pandas)\n",
|
|
" Using cached tzdata-2025.2-py2.py3-none-any.whl.metadata (1.4 kB)\n",
|
|
"Requirement already satisfied: six>=1.5 in ./.venv/lib/python3.12/site-packages (from python-dateutil>=2.8.2->pandas) (1.17.0)\n",
|
|
"Downloading pandas-2.3.3-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (12.4 MB)\n",
|
|
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m12.4/12.4 MB\u001b[0m \u001b[31m9.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m:00:01\u001b[0m00:01\u001b[0m\n",
|
|
"\u001b[?25hDownloading numpy-2.3.3-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (16.6 MB)\n",
|
|
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m16.6/16.6 MB\u001b[0m \u001b[31m11.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n",
|
|
"\u001b[?25hUsing cached pytz-2025.2-py2.py3-none-any.whl (509 kB)\n",
|
|
"Using cached tzdata-2025.2-py2.py3-none-any.whl (347 kB)\n",
|
|
"Installing collected packages: pytz, tzdata, numpy, pandas\n",
|
|
"Successfully installed numpy-2.3.3 pandas-2.3.3 pytz-2025.2 tzdata-2025.2\n",
|
|
"Note: you may need to restart the kernel to use updated packages.\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"pip install pandas"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 25,
|
|
"id": "5bbeed9a",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"import pandas as pd\n",
|
|
"from pathlib import Path\n",
|
|
"from dataclasses import dataclass\n",
|
|
"\n",
|
|
"class Experimento:\n",
|
|
" def __init__(self, volt_iny, volt_elec, corr_elec, resistencia):\n",
|
|
" self.volt_iny = volt_iny\n",
|
|
" self.volt_elec = volt_elec\n",
|
|
" self.corr_elec = corr_elec\n",
|
|
" self.resistencia = resistencia"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 39,
|
|
"id": "12b2d8f0",
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"The min value of the exp_1 are: 0.6 V, length: 77\n",
|
|
"The min value of the exp_2 are: 0.3 V, length: 85\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"\n",
|
|
"path_1 = Path(\"/home/mgph/Desktop/?/MAESTRIA/HYDROGEN_PROJ/Data/Experimental-Data/EXP-A_20250917_163949.csv\") # Path for the experiment 20250917\n",
|
|
"path_2 = Path(\"/home/mgph/Desktop/?/MAESTRIA/HYDROGEN_PROJ/Data/Experimental-Data/EXP-A_20250922_100524.csv\") # Path for the experiment 20250922\n",
|
|
"# Import the experiment \"20250917\"\n",
|
|
"df_1 = pd.read_csv(path_1, encoding=\"latin-1\")\n",
|
|
"# Import the experiment \"20250922\"\n",
|
|
"df_2 = pd.read_csv(path_2, encoding=\"latin-1\")\n",
|
|
"#df_1.head() \n",
|
|
"#df_1.head()\n",
|
|
"\n",
|
|
"cols_extract = [\"Voltaje Inyectado (V)\", \"Voltaje Electrodos (V)\", \"Corriente Electrodos (A)\", \"Resistencia\"]\n",
|
|
"dt_exp1 = df_1[cols_extract].copy()\n",
|
|
"dt_exp2 = df_2[cols_extract].copy()\n",
|
|
"\n",
|
|
"exp_1 = Experimento(\n",
|
|
" volt_iny = dt_exp1[\"Voltaje Inyectado (V)\"], \n",
|
|
" volt_elec = dt_exp1[\"Voltaje Electrodos (V)\"],\n",
|
|
" corr_elec = dt_exp1[\"Corriente Electrodos (A)\"],\n",
|
|
" resistencia = dt_exp1[\"Resistencia\"],\n",
|
|
")\n",
|
|
"\n",
|
|
"exp_2 = Experimento(\n",
|
|
" volt_iny = dt_exp2[\"Voltaje Inyectado (V)\"], \n",
|
|
" volt_elec = dt_exp2[\"Voltaje Electrodos (V)\"],\n",
|
|
" corr_elec = dt_exp2[\"Corriente Electrodos (A)\"],\n",
|
|
" resistencia = dt_exp2[\"Resistencia\"],\n",
|
|
")\n",
|
|
"\n",
|
|
"min_val_exp1 = min(exp_1.volt_iny)\n",
|
|
"min_val_exp2 = min(exp_2.volt_iny)\n",
|
|
"\n",
|
|
"print(f\"The min value of the exp_1 are: {min_val_exp1} V, length: {len(exp_1.volt_iny)}\")\n",
|
|
"print(f\"The min value of the exp_2 are: {min_val_exp2} V, length: {len(exp_2.volt_iny)}\")"
|
|
]
|
|
}
|
|
],
|
|
"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
|
|
}
|