diff --git a/notebooks/testing_logratio_transformations.ipynb b/notebooks/testing_logratio_transformations.ipynb index f8f62961..19f377aa 100644 --- a/notebooks/testing_logratio_transformations.ipynb +++ b/notebooks/testing_logratio_transformations.ipynb @@ -20,9 +20,8 @@ "name": "stderr", "output_type": "stream", "text": [ - "/root/.cache/pypoetry/virtualenvs/eis-toolkit-QEzTY9B6-py3.10/lib/python3.10/site-packages/beartype/_util/hint/pep/utilpeptest.py:347: BeartypeDecorHintPep585DeprecationWarning: PEP 484 type hint typing.Sequence[str] deprecated by PEP 585. This hint is scheduled for removal in the first Python version released after October 5th, 2025. To resolve this, import this hint from \"beartype.typing\" rather than \"typing\". For further commentary and alternatives, see also:\n", - " https://beartype.readthedocs.io/en/latest/api_roar/#pep-585-deprecations\n", - " warn(\n" + "/root/.cache/pypoetry/virtualenvs/eis-toolkit-QEzTY9B6-py3.10/lib/python3.10/site-packages/geopandas/_compat.py:112: UserWarning: The Shapely GEOS version (3.10.3-CAPI-1.16.1) is incompatible with the GEOS version PyGEOS was compiled with (3.10.4-CAPI-1.16.2). Conversions between both will be slow.\n", + " warnings.warn(\n" ] } ], @@ -727,7 +726,7 @@ { "cell_type": "code", "execution_count": 21, - "id": "e1bda63b-ab9b-4060-90d5-7520952f2e3a", + "id": "41bfcb78-bdfa-4c03-a9b4-45c2258c60a8", "metadata": { "tags": [] }, @@ -757,7 +756,6 @@ " Ca_ppm_511\n", " Fe_ppm_511\n", " Mg_ppm_511\n", - " residual\n", " \n", " \n", " \n", @@ -767,7 +765,6 @@ " 40200.0\n", " 83200.0\n", " 17200.0\n", - " 831800.0\n", " \n", " \n", " 1\n", @@ -775,7 +772,6 @@ " 5000.0\n", " 28300.0\n", " 7520.0\n", - " 945080.0\n", " \n", " \n", " 2\n", @@ -783,7 +779,6 @@ " 3070.0\n", " 14500.0\n", " 4540.0\n", - " 970010.0\n", " \n", " \n", " 3\n", @@ -791,7 +786,6 @@ " 3290.0\n", " 14600.0\n", " 3240.0\n", - " 971570.0\n", " \n", " \n", " 4\n", @@ -799,19 +793,18 @@ " 3600.0\n", " 31500.0\n", " 8020.0\n", - " 944380.0\n", " \n", " \n", "\n", "" ], "text/plain": [ - " Al_ppm_511 Ca_ppm_511 Fe_ppm_511 Mg_ppm_511 residual\n", - "0 27600.0 40200.0 83200.0 17200.0 831800.0\n", - "1 14100.0 5000.0 28300.0 7520.0 945080.0\n", - "2 7880.0 3070.0 14500.0 4540.0 970010.0\n", - "3 7300.0 3290.0 14600.0 3240.0 971570.0\n", - "4 12500.0 3600.0 31500.0 8020.0 944380.0" + " Al_ppm_511 Ca_ppm_511 Fe_ppm_511 Mg_ppm_511\n", + "0 27600.0 40200.0 83200.0 17200.0\n", + "1 14100.0 5000.0 28300.0 7520.0\n", + "2 7880.0 3070.0 14500.0 4540.0\n", + "3 7300.0 3290.0 14600.0 3240.0\n", + "4 12500.0 3600.0 31500.0 8020.0" ] }, "execution_count": 21, @@ -825,15 +818,12 @@ "df = gpd.read_file(GEOCHEMICAL_DATA, include_fields=elements_to_analyze)\n", "df = pd.DataFrame(df.drop(columns='geometry'))\n", "\n", - "# Add a column for the residual\n", - "\n", - "df[\"residual\"] = million - np.sum(df, axis=1)\n", "df.head()" ] }, { "cell_type": "code", - "execution_count": 24, + "execution_count": 22, "id": "75728aa4-5b2e-46b6-9511-1250bf4b13ae", "metadata": { "tags": [] @@ -843,7 +833,6 @@ "pair_Al_Ca = pairwise_logratio(df, \"Al_ppm_511\", \"Ca_ppm_511\")\n", "pair_Fe_Mg = pairwise_logratio(df, \"Fe_ppm_511\", \"Mg_ppm_511\")\n", "pair_Mg_Al = pairwise_logratio(df, \"Mg_ppm_511\", \"Al_ppm_511\")\n", - "pair_Mg_res = pairwise_logratio(df, \"Mg_ppm_511\", \"residual\")\n", "\n", "df_alr = alr_transform(df)\n", "df_alr_Mg = alr_transform(df, \"Mg_ppm_511\")\n", @@ -859,7 +848,7 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": 23, "id": "e136d05d-671d-420f-95b9-5f350bc7a94c", "metadata": { "tags": [] @@ -876,7 +865,7 @@ "dtype: float64" ] }, - "execution_count": 25, + "execution_count": 23, "metadata": {}, "output_type": "execute_result" } @@ -887,7 +876,7 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": 24, "id": "ad352680-433a-4026-b7b5-560b682dfb96", "metadata": { "tags": [] @@ -917,7 +906,6 @@ " V1\n", " V2\n", " V3\n", - " V4\n", " \n", " \n", " \n", @@ -926,50 +914,45 @@ " 0.472906\n", " 0.848958\n", " 1.576338\n", - " 3.878683\n", " \n", " \n", " 1\n", " 0.628609\n", " -0.408128\n", " 1.325296\n", - " 4.833703\n", " \n", " \n", " 2\n", " 0.551401\n", " -0.391249\n", " 1.161222\n", - " 5.364379\n", " \n", " \n", " 3\n", " 0.812301\n", " 0.015314\n", " 1.505448\n", - " 5.703340\n", " \n", " \n", " 4\n", " 0.443790\n", " -0.801005\n", " 1.368049\n", - " 4.768590\n", " \n", " \n", "\n", "" ], "text/plain": [ - " V1 V2 V3 V4\n", - "0 0.472906 0.848958 1.576338 3.878683\n", - "1 0.628609 -0.408128 1.325296 4.833703\n", - "2 0.551401 -0.391249 1.161222 5.364379\n", - "3 0.812301 0.015314 1.505448 5.703340\n", - "4 0.443790 -0.801005 1.368049 4.768590" + " V1 V2 V3\n", + "0 0.472906 0.848958 1.576338\n", + "1 0.628609 -0.408128 1.325296\n", + "2 0.551401 -0.391249 1.161222\n", + "3 0.812301 0.015314 1.505448\n", + "4 0.443790 -0.801005 1.368049" ] }, - "execution_count": 26, + "execution_count": 24, "metadata": {}, "output_type": "execute_result" } @@ -977,14 +960,6 @@ "source": [ "df_alr_Mg.head()" ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "8b6a1929-51ef-4b7a-8621-f46bbe337e31", - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": {