commit 3a31af37f0e5f769040f7c23327efd24fefc6b55 Author: janeoa <5373400+janeoa@users.noreply.github.com> Date: Sat Mar 14 11:48:48 2026 +0100 init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cc18fb2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,209 @@ +# Created by https://www.toptal.com/developers/gitignore/api/macos,python +# Edit at https://www.toptal.com/developers/gitignore?templates=macos,python + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### macOS Patch ### +# iCloud generated files +*.icloud + +### Python ### +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# poetry +# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control +#poetry.lock + +# pdm +# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. +#pdm.lock +# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it +# in version control. +# https://pdm.fming.dev/#use-with-ide +.pdm.toml + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ + +# PyCharm +# JetBrains specific template is maintained in a separate JetBrains.gitignore that can +# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore +# and can be added to the global gitignore or merged into this file. For a more nuclear +# option (not recommended) you can uncomment the following to ignore the entire idea folder. +#.idea/ + +### Python Patch ### +# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration +poetry.toml + +# ruff +.ruff_cache/ + +# LSP config files +pyrightconfig.json + +# End of https://www.toptal.com/developers/gitignore/api/macos,python diff --git a/README.md b/README.md new file mode 100644 index 0000000..e9a720c --- /dev/null +++ b/README.md @@ -0,0 +1,16 @@ +# Setup + +Install dependencies: + +```bash +pip install -r requirements.txt +``` + +## Run + +Open the notebook in Jupyter: + +```bash +jupyter notebook +``` + diff --git a/Tc pH assay siderite.xlsx b/Tc pH assay siderite.xlsx new file mode 100644 index 0000000..e5ff07a Binary files /dev/null and b/Tc pH assay siderite.xlsx differ diff --git a/hehe1.ipynb b/hehe1.ipynb new file mode 100644 index 0000000..95301b6 --- /dev/null +++ b/hehe1.ipynb @@ -0,0 +1,771 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "f5257869", + "metadata": {}, + "source": [ + "# Step 1 is to import Data. \n", + "Seems like it is possible to import ur Excel directly:" + ] + }, + { + "cell_type": "markdown", + "id": "003d5178", + "metadata": {}, + "source": [ + "## Here are the import. Not that important" + ] + }, + { + "cell_type": "code", + "execution_count": 47, + "id": "7594a3a3", + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "from dataclasses import dataclass\n", + "from datetime import date, datetime" + ] + }, + { + "cell_type": "markdown", + "id": "c276e1f8", + "metadata": {}, + "source": [ + "## Here is the data" + ] + }, + { + "cell_type": "markdown", + "id": "6ee960c6", + "metadata": {}, + "source": [ + "### \"LSC raw data\" sheet has two tables" + ] + }, + { + "cell_type": "code", + "execution_count": 42, + "id": "87639af2-44c8-425f-bd0d-37348e1fbaa3", + "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", + "
PositionSample_IDCPMEfficiencyDPM im VialBq im VialError 2S%Lumi %TDCR
0A01blank68.34NaNNaNNaN7.6534.0390.278
1A02Tc stock 10e-4M65636.100.97567331.401122.1900.2520.0190.972
2A03Tc_sid_20min_4a7069.880.9757250.55120.8420.7510.0730.972
3A04Tc_sid_20min_5a7887.320.9778075.90134.5980.7110.0690.974
4A05Tc_sid_20min_6a-17.610.8020.000.0008.8826.6630.757
\n", + "
" + ], + "text/plain": [ + " Position Sample_ID CPM Efficiency DPM im Vial Bq im Vial \\\n", + "0 A01 blank 68.34 NaN NaN NaN \n", + "1 A02 Tc stock 10e-4M 65636.10 0.975 67331.40 1122.190 \n", + "2 A03 Tc_sid_20min_4a 7069.88 0.975 7250.55 120.842 \n", + "3 A04 Tc_sid_20min_5a 7887.32 0.977 8075.90 134.598 \n", + "4 A05 Tc_sid_20min_6a -17.61 0.802 0.00 0.000 \n", + "\n", + " Error 2S% Lumi % TDCR \n", + "0 7.653 4.039 0.278 \n", + "1 0.252 0.019 0.972 \n", + "2 0.751 0.073 0.972 \n", + "3 0.711 0.069 0.974 \n", + "4 8.882 6.663 0.757 " + ] + }, + "execution_count": 42, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "LSC_raw_data_part1 = pd.read_excel(\"Tc pH assay siderite.xlsx\", sheet_name=\"LSC raw data\", nrows=14)\n", + "LSC_raw_data_part1.head()" + ] + }, + { + "cell_type": "markdown", + "id": "09585c9a", + "metadata": {}, + "source": [ + "The second table starts at 18th row, so I had to skip some rows and also the column A for table 2 is empty, so I did the `usecols` range" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "id": "ba4cf093", + "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", + "
Unnamed: 1Unnamed: 2Unnamed: 3Unnamed: 4Unnamed: 5Unnamed: 6Unnamed: 7Unnamed: 8Unnamed: 9Unnamed: 10
0Sample_IDCPMEfficiencyDPM im VialLSC, mLTc aliquot, mLVial, Bq/mlSample, Bq/mlSample [99Tc], mMSample [99Tc], mM
1Tc stock 10e-4M65636.10.97567331.450.2215.8057695610.950.0895470.00009
\n", + "
" + ], + "text/plain": [ + " Unnamed: 1 Unnamed: 2 Unnamed: 3 Unnamed: 4 Unnamed: 5 \\\n", + "0 Sample_ID CPM Efficiency DPM im Vial LSC, mL \n", + "1 Tc stock 10e-4M 65636.1 0.975 67331.4 5 \n", + "\n", + " Unnamed: 6 Unnamed: 7 Unnamed: 8 Unnamed: 9 \\\n", + "0 Tc aliquot, mL Vial, Bq/ml Sample, Bq/ml Sample [99Tc], mM \n", + "1 0.2 215.805769 5610.95 0.089547 \n", + "\n", + " Unnamed: 10 \n", + "0 Sample [99Tc], mM \n", + "1 0.00009 " + ] + }, + "execution_count": 43, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "LSC_raw_data_part2 = pd.read_excel(\"Tc pH assay siderite.xlsx\", sheet_name=\"LSC raw data\",skiprows=16, usecols=\"B:K\")\n", + "LSC_raw_data_part2.head()" + ] + }, + { + "cell_type": "markdown", + "id": "9f781886", + "metadata": {}, + "source": [ + "### LSC data" + ] + }, + { + "cell_type": "code", + "execution_count": 49, + "id": "0849ddc0", + "metadata": {}, + "outputs": [], + "source": [ + "@dataclass\n", + "class LSC_data:\n", + " description: str\n", + " measured_date: date\n", + " data_blank: pd.DataFrame = None\n", + " data_stock: pd.DataFrame = None\n", + " data_20min: pd.DataFrame = None" + ] + }, + { + "cell_type": "code", + "execution_count": 50, + "id": "28c3d5a6", + "metadata": {}, + "outputs": [], + "source": [ + "LSC_data_TC_11_03_26 = LSC_data(\n", + " description=\"1E-5 M Tc with 1.3 g/L of siderite, after 30 min\",\n", + " measured_date=datetime.strptime(\"11.03.2026\", \"%d.%m.%Y\").date(),\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": 51, + "id": "d6ee04cb", + "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", + "
PositionsSample IDcpmLSC, mL
0A01blank68.345
\n", + "
" + ], + "text/plain": [ + " Positions Sample ID cpm LSC, mL\n", + "0 A01 blank 68.34 5" + ] + }, + "execution_count": 51, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "LSC_data_TC_11_03_26.data_blank = pd.read_excel(\"Tc pH assay siderite.xlsx\", sheet_name=\"LSC data\",nrows=1, skiprows=4, usecols=\"A:C, F\")\n", + "LSC_data_TC_11_03_26.data_blank" + ] + }, + { + "cell_type": "code", + "execution_count": 67, + "id": "64965457", + "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", + "
PositionsSample IDcpmEfficiencyDPM in vialLSC, mLTc aliquot, mLVial, Bq/mlSample, Bq/mlSample [99Tc], MLSC waste, Bq/mLBq, solid waste
0A02Tc stock 10e-4M65636.10.97567331.450.2215.8057695610.950.00009215.80576928054.75
\n", + "
" + ], + "text/plain": [ + " Positions Sample ID cpm Efficiency DPM in vial LSC, mL \\\n", + "0 A02 Tc stock 10e-4M 65636.1 0.975 67331.4 5 \n", + "\n", + " Tc aliquot, mL Vial, Bq/ml Sample, Bq/ml Sample [99Tc], M \\\n", + "0 0.2 215.805769 5610.95 0.00009 \n", + "\n", + " LSC waste, Bq/mL Bq, solid waste \n", + "0 215.805769 28054.75 " + ] + }, + "execution_count": 67, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "LSC_data_TC_11_03_26.data_stock = pd.read_excel(\"Tc pH assay siderite.xlsx\", sheet_name=\"LSC data\", skiprows=[0,1,2,3,5], nrows=1)\n", + "LSC_data_TC_11_03_26.data_stock" + ] + }, + { + "cell_type": "code", + "execution_count": 71, + "id": "6a867236", + "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", + " \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", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
PositionsSample IDcpmEfficiencyDPM in vialLSC, mLTc aliquot, mLVial, Bq/mlSample, Bq/mlSample [99Tc], MLSC waste, Bq/mLBq, solid waste
0A03Tc_sid_20min_4a7069.880.9757250.55050.223.238942604.2125009.642853e-0623.238942-215.587500
1A04Tc_sid_20min_5a7887.320.9778075.90050.225.884295672.9916671.074053e-0525.884295-559.483333
2A05Tc_sid_20min_6a-17.610.8020.00050.20.0000000.0000000.000000e+000.0000002805.475000
3A06Tc_sid_20min_6b1760.910.9701814.95050.25.817147151.2458332.413789e-065.8171472049.245833
4B01Tc_sid_20min_8a93.140.886105.15050.20.3370198.7625001.398440e-070.3370192761.662500
5B02Tc_sid_20min_8b425.420.900472.84850.21.51553839.4040006.288632e-071.5155382608.455000
6B03Tc_sid_20min_10a64.610.91870.41250.20.2256795.8676679.364429e-080.2256792776.136667
7B04Tc_sid_20min_10b-38.330.7910.00050.20.0000000.0000000.000000e+000.0000002805.475000
8B05Tc_sid_20min_12a205.380.930220.94450.20.70815418.4120002.938440e-070.7081542713.415000
9B06Tc_sid_20min_12b-30.530.7820.00050.20.0000000.0000000.000000e+000.0000002805.475000
\n", + "
" + ], + "text/plain": [ + " Positions Sample ID cpm Efficiency DPM in vial LSC, mL \\\n", + "0 A03 Tc_sid_20min_4a 7069.88 0.975 7250.550 5 \n", + "1 A04 Tc_sid_20min_5a 7887.32 0.977 8075.900 5 \n", + "2 A05 Tc_sid_20min_6a -17.61 0.802 0.000 5 \n", + "3 A06 Tc_sid_20min_6b 1760.91 0.970 1814.950 5 \n", + "4 B01 Tc_sid_20min_8a 93.14 0.886 105.150 5 \n", + "5 B02 Tc_sid_20min_8b 425.42 0.900 472.848 5 \n", + "6 B03 Tc_sid_20min_10a 64.61 0.918 70.412 5 \n", + "7 B04 Tc_sid_20min_10b -38.33 0.791 0.000 5 \n", + "8 B05 Tc_sid_20min_12a 205.38 0.930 220.944 5 \n", + "9 B06 Tc_sid_20min_12b -30.53 0.782 0.000 5 \n", + "\n", + " Tc aliquot, mL Vial, Bq/ml Sample, Bq/ml Sample [99Tc], M \\\n", + "0 0.2 23.238942 604.212500 9.642853e-06 \n", + "1 0.2 25.884295 672.991667 1.074053e-05 \n", + "2 0.2 0.000000 0.000000 0.000000e+00 \n", + "3 0.2 5.817147 151.245833 2.413789e-06 \n", + "4 0.2 0.337019 8.762500 1.398440e-07 \n", + "5 0.2 1.515538 39.404000 6.288632e-07 \n", + "6 0.2 0.225679 5.867667 9.364429e-08 \n", + "7 0.2 0.000000 0.000000 0.000000e+00 \n", + "8 0.2 0.708154 18.412000 2.938440e-07 \n", + "9 0.2 0.000000 0.000000 0.000000e+00 \n", + "\n", + " LSC waste, Bq/mL Bq, solid waste \n", + "0 23.238942 -215.587500 \n", + "1 25.884295 -559.483333 \n", + "2 0.000000 2805.475000 \n", + "3 5.817147 2049.245833 \n", + "4 0.337019 2761.662500 \n", + "5 1.515538 2608.455000 \n", + "6 0.225679 2776.136667 \n", + "7 0.000000 2805.475000 \n", + "8 0.708154 2713.415000 \n", + "9 0.000000 2805.475000 " + ] + }, + "execution_count": 71, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "LSC_data_TC_11_03_26.data_20min = pd.read_excel(\"Tc pH assay siderite.xlsx\", sheet_name=\"LSC data\",skiprows=[0,1,2,3,5,6], nrows=10)\n", + "LSC_data_TC_11_03_26.data_20min" + ] + }, + { + "cell_type": "code", + "execution_count": 73, + "id": "ca670fd3", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "LSC waste, Bq/mL 57.726776\n", + "Bq, solid waste 20550.269167\n", + "dtype: float64" + ] + }, + "execution_count": 73, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "LSC_data_TC_11_03_26.data_20min[[\"LSC waste, Bq/mL\", \"Bq, solid waste\"]].sum()\n" + ] + }, + { + "cell_type": "markdown", + "id": "d01c706b", + "metadata": {}, + "source": [ + "# Step 2: Do data anal" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0bb6ad81", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "id": "d658c450", + "metadata": {}, + "source": [ + "# Step 3: Plot the data" + ] + } + ], + "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.14.3" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..2f5b8d3 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +pandas +openpyxl \ No newline at end of file