|
20 | 20 | "name": "stderr",
|
21 | 21 | "output_type": "stream",
|
22 | 22 | "text": [
|
23 |
| - "/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", |
24 |
| - " warnings.warn(\n" |
| 23 | + "/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", |
| 24 | + " https://beartype.readthedocs.io/en/latest/api_roar/#pep-585-deprecations\n", |
| 25 | + " warn(\n" |
25 | 26 | ]
|
26 | 27 | }
|
27 | 28 | ],
|
|
726 | 727 | {
|
727 | 728 | "cell_type": "code",
|
728 | 729 | "execution_count": 21,
|
729 |
| - "id": "41bfcb78-bdfa-4c03-a9b4-45c2258c60a8", |
| 730 | + "id": "e1bda63b-ab9b-4060-90d5-7520952f2e3a", |
730 | 731 | "metadata": {
|
731 | 732 | "tags": []
|
732 | 733 | },
|
|
756 | 757 | " <th>Ca_ppm_511</th>\n",
|
757 | 758 | " <th>Fe_ppm_511</th>\n",
|
758 | 759 | " <th>Mg_ppm_511</th>\n",
|
| 760 | + " <th>residual</th>\n", |
759 | 761 | " </tr>\n",
|
760 | 762 | " </thead>\n",
|
761 | 763 | " <tbody>\n",
|
|
765 | 767 | " <td>40200.0</td>\n",
|
766 | 768 | " <td>83200.0</td>\n",
|
767 | 769 | " <td>17200.0</td>\n",
|
| 770 | + " <td>831800.0</td>\n", |
768 | 771 | " </tr>\n",
|
769 | 772 | " <tr>\n",
|
770 | 773 | " <th>1</th>\n",
|
771 | 774 | " <td>14100.0</td>\n",
|
772 | 775 | " <td>5000.0</td>\n",
|
773 | 776 | " <td>28300.0</td>\n",
|
774 | 777 | " <td>7520.0</td>\n",
|
| 778 | + " <td>945080.0</td>\n", |
775 | 779 | " </tr>\n",
|
776 | 780 | " <tr>\n",
|
777 | 781 | " <th>2</th>\n",
|
778 | 782 | " <td>7880.0</td>\n",
|
779 | 783 | " <td>3070.0</td>\n",
|
780 | 784 | " <td>14500.0</td>\n",
|
781 | 785 | " <td>4540.0</td>\n",
|
| 786 | + " <td>970010.0</td>\n", |
782 | 787 | " </tr>\n",
|
783 | 788 | " <tr>\n",
|
784 | 789 | " <th>3</th>\n",
|
785 | 790 | " <td>7300.0</td>\n",
|
786 | 791 | " <td>3290.0</td>\n",
|
787 | 792 | " <td>14600.0</td>\n",
|
788 | 793 | " <td>3240.0</td>\n",
|
| 794 | + " <td>971570.0</td>\n", |
789 | 795 | " </tr>\n",
|
790 | 796 | " <tr>\n",
|
791 | 797 | " <th>4</th>\n",
|
792 | 798 | " <td>12500.0</td>\n",
|
793 | 799 | " <td>3600.0</td>\n",
|
794 | 800 | " <td>31500.0</td>\n",
|
795 | 801 | " <td>8020.0</td>\n",
|
| 802 | + " <td>944380.0</td>\n", |
796 | 803 | " </tr>\n",
|
797 | 804 | " </tbody>\n",
|
798 | 805 | "</table>\n",
|
799 | 806 | "</div>"
|
800 | 807 | ],
|
801 | 808 | "text/plain": [
|
802 |
| - " Al_ppm_511 Ca_ppm_511 Fe_ppm_511 Mg_ppm_511\n", |
803 |
| - "0 27600.0 40200.0 83200.0 17200.0\n", |
804 |
| - "1 14100.0 5000.0 28300.0 7520.0\n", |
805 |
| - "2 7880.0 3070.0 14500.0 4540.0\n", |
806 |
| - "3 7300.0 3290.0 14600.0 3240.0\n", |
807 |
| - "4 12500.0 3600.0 31500.0 8020.0" |
| 809 | + " Al_ppm_511 Ca_ppm_511 Fe_ppm_511 Mg_ppm_511 residual\n", |
| 810 | + "0 27600.0 40200.0 83200.0 17200.0 831800.0\n", |
| 811 | + "1 14100.0 5000.0 28300.0 7520.0 945080.0\n", |
| 812 | + "2 7880.0 3070.0 14500.0 4540.0 970010.0\n", |
| 813 | + "3 7300.0 3290.0 14600.0 3240.0 971570.0\n", |
| 814 | + "4 12500.0 3600.0 31500.0 8020.0 944380.0" |
808 | 815 | ]
|
809 | 816 | },
|
810 | 817 | "execution_count": 21,
|
|
818 | 825 | "df = gpd.read_file(GEOCHEMICAL_DATA, include_fields=elements_to_analyze)\n",
|
819 | 826 | "df = pd.DataFrame(df.drop(columns='geometry'))\n",
|
820 | 827 | "\n",
|
| 828 | + "# Add a column for the residual\n", |
| 829 | + "\n", |
| 830 | + "df[\"residual\"] = million - np.sum(df, axis=1)\n", |
821 | 831 | "df.head()"
|
822 | 832 | ]
|
823 | 833 | },
|
824 | 834 | {
|
825 | 835 | "cell_type": "code",
|
826 |
| - "execution_count": 22, |
| 836 | + "execution_count": 24, |
827 | 837 | "id": "75728aa4-5b2e-46b6-9511-1250bf4b13ae",
|
828 | 838 | "metadata": {
|
829 | 839 | "tags": []
|
|
833 | 843 | "pair_Al_Ca = pairwise_logratio(df, \"Al_ppm_511\", \"Ca_ppm_511\")\n",
|
834 | 844 | "pair_Fe_Mg = pairwise_logratio(df, \"Fe_ppm_511\", \"Mg_ppm_511\")\n",
|
835 | 845 | "pair_Mg_Al = pairwise_logratio(df, \"Mg_ppm_511\", \"Al_ppm_511\")\n",
|
| 846 | + "pair_Mg_res = pairwise_logratio(df, \"Mg_ppm_511\", \"residual\")\n", |
836 | 847 | "\n",
|
837 | 848 | "df_alr = alr_transform(df)\n",
|
838 | 849 | "df_alr_Mg = alr_transform(df, \"Mg_ppm_511\")\n",
|
|
848 | 859 | },
|
849 | 860 | {
|
850 | 861 | "cell_type": "code",
|
851 |
| - "execution_count": 23, |
| 862 | + "execution_count": 25, |
852 | 863 | "id": "e136d05d-671d-420f-95b9-5f350bc7a94c",
|
853 | 864 | "metadata": {
|
854 | 865 | "tags": []
|
|
865 | 876 | "dtype: float64"
|
866 | 877 | ]
|
867 | 878 | },
|
868 |
| - "execution_count": 23, |
| 879 | + "execution_count": 25, |
869 | 880 | "metadata": {},
|
870 | 881 | "output_type": "execute_result"
|
871 | 882 | }
|
|
876 | 887 | },
|
877 | 888 | {
|
878 | 889 | "cell_type": "code",
|
879 |
| - "execution_count": 24, |
| 890 | + "execution_count": 26, |
880 | 891 | "id": "ad352680-433a-4026-b7b5-560b682dfb96",
|
881 | 892 | "metadata": {
|
882 | 893 | "tags": []
|
|
906 | 917 | " <th>V1</th>\n",
|
907 | 918 | " <th>V2</th>\n",
|
908 | 919 | " <th>V3</th>\n",
|
| 920 | + " <th>V4</th>\n", |
909 | 921 | " </tr>\n",
|
910 | 922 | " </thead>\n",
|
911 | 923 | " <tbody>\n",
|
|
914 | 926 | " <td>0.472906</td>\n",
|
915 | 927 | " <td>0.848958</td>\n",
|
916 | 928 | " <td>1.576338</td>\n",
|
| 929 | + " <td>3.878683</td>\n", |
917 | 930 | " </tr>\n",
|
918 | 931 | " <tr>\n",
|
919 | 932 | " <th>1</th>\n",
|
920 | 933 | " <td>0.628609</td>\n",
|
921 | 934 | " <td>-0.408128</td>\n",
|
922 | 935 | " <td>1.325296</td>\n",
|
| 936 | + " <td>4.833703</td>\n", |
923 | 937 | " </tr>\n",
|
924 | 938 | " <tr>\n",
|
925 | 939 | " <th>2</th>\n",
|
926 | 940 | " <td>0.551401</td>\n",
|
927 | 941 | " <td>-0.391249</td>\n",
|
928 | 942 | " <td>1.161222</td>\n",
|
| 943 | + " <td>5.364379</td>\n", |
929 | 944 | " </tr>\n",
|
930 | 945 | " <tr>\n",
|
931 | 946 | " <th>3</th>\n",
|
932 | 947 | " <td>0.812301</td>\n",
|
933 | 948 | " <td>0.015314</td>\n",
|
934 | 949 | " <td>1.505448</td>\n",
|
| 950 | + " <td>5.703340</td>\n", |
935 | 951 | " </tr>\n",
|
936 | 952 | " <tr>\n",
|
937 | 953 | " <th>4</th>\n",
|
938 | 954 | " <td>0.443790</td>\n",
|
939 | 955 | " <td>-0.801005</td>\n",
|
940 | 956 | " <td>1.368049</td>\n",
|
| 957 | + " <td>4.768590</td>\n", |
941 | 958 | " </tr>\n",
|
942 | 959 | " </tbody>\n",
|
943 | 960 | "</table>\n",
|
944 | 961 | "</div>"
|
945 | 962 | ],
|
946 | 963 | "text/plain": [
|
947 |
| - " V1 V2 V3\n", |
948 |
| - "0 0.472906 0.848958 1.576338\n", |
949 |
| - "1 0.628609 -0.408128 1.325296\n", |
950 |
| - "2 0.551401 -0.391249 1.161222\n", |
951 |
| - "3 0.812301 0.015314 1.505448\n", |
952 |
| - "4 0.443790 -0.801005 1.368049" |
| 964 | + " V1 V2 V3 V4\n", |
| 965 | + "0 0.472906 0.848958 1.576338 3.878683\n", |
| 966 | + "1 0.628609 -0.408128 1.325296 4.833703\n", |
| 967 | + "2 0.551401 -0.391249 1.161222 5.364379\n", |
| 968 | + "3 0.812301 0.015314 1.505448 5.703340\n", |
| 969 | + "4 0.443790 -0.801005 1.368049 4.768590" |
953 | 970 | ]
|
954 | 971 | },
|
955 |
| - "execution_count": 24, |
| 972 | + "execution_count": 26, |
956 | 973 | "metadata": {},
|
957 | 974 | "output_type": "execute_result"
|
958 | 975 | }
|
959 | 976 | ],
|
960 | 977 | "source": [
|
961 | 978 | "df_alr_Mg.head()"
|
962 | 979 | ]
|
| 980 | + }, |
| 981 | + { |
| 982 | + "cell_type": "code", |
| 983 | + "execution_count": null, |
| 984 | + "id": "8b6a1929-51ef-4b7a-8621-f46bbe337e31", |
| 985 | + "metadata": {}, |
| 986 | + "outputs": [], |
| 987 | + "source": [] |
963 | 988 | }
|
964 | 989 | ],
|
965 | 990 | "metadata": {
|
|
0 commit comments