{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# MagmaFrame basics" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "import MagmaPandas as mp\n", "import pandas as pd" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "You read in .csv files with the read functions. Each phase has it's own read function, e.g. *read_melt()*, and MagmaPandas currently supports melt, olivine, clinopyroxene and plagioclase.\n", "\n", "All read functions eventually call *pandas.read_csv()*, where all keyword arguments get passed. The read functions expect all data to be in oxide wt. %, but anions can be kept as elements." ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "melt_file = \"./data/melts.csv\"\n", "olivine_file = \"./data/olivines.csv\"\n", "\n", "melt = mp.read_melt(melt_file, index_col=[\"name\"])\n", "olivine = mp.read_olivine(olivine_file, index_col=[\"name\"])\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Data can also be read directly to a MagmaFrame, using the same syntax as pandas DataFrames, with the exception that datatype ('*cation*', '*oxide*') and units ('*mol fraction*', '*wt. %*', '*ppm*')) need to be specified.\n", "\n", "Currently available MagmaFrames are *MagmaFrame*, *Melt*, *Olivine*, *Clinopyroxene*, and *Plagioclase*." ] }, { "cell_type": "code", "execution_count": 4, "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", "
SiO2FeOMgO
ol_138.516.044.4
ol_237.915.944.3
\n", "
" ], "text/plain": [ " SiO2 FeO MgO\n", "ol_1 38.5 16.0 44.4\n", "ol_2 37.9 15.9 44.3" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "mp.Olivine({\"SiO2\": [38.5, 37.9], \"FeO\": [16.0, 15.9], \"MgO\": [44.4, 44.3]}, datatype=\"oxide\", units=\"wt. %\", index=[\"ol_1\", \"ol_2\"])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "MagmaFrames and MagmaSeries have the underlying structure of pandas DataFrames and Series and can use all of their methods:" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(True, True)" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "isinstance(melt, pd.DataFrame), isinstance(melt.iloc[0], pd.Series)" ] }, { "cell_type": "code", "execution_count": 6, "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", " \n", " \n", " \n", " \n", " \n", " \n", "
SiO2Al2O3MgOCaOFeONa2OK2OMnOTiO2P2O5CO2H2OFSCltotal
count10.00000010.00000010.00000010.00000010.00000010.00000010.00000010.00000010.00000010.00000010.00000010.00000010.00000010.00000010.00000010.0
mean47.37231416.2054205.7415709.98125010.4366153.7793191.2251550.1443972.9454120.5572520.5672060.7864000.0799620.1228890.050053100.0
std1.6659981.1835141.2792530.7402691.0421550.5922920.2782100.0386570.6006000.1556610.1745960.4169880.0146640.0345450.0131330.0
min45.31333914.5390623.7756588.9264918.3981513.1778350.6977690.0888991.7761850.2898230.2901550.2933410.0476540.0680200.021157100.0
25%45.88851515.5116124.7706489.4545049.7999383.3642381.0945560.1331342.5745740.5264170.4666330.4919660.0768880.0954400.046920100.0
50%47.04117815.8314926.5088319.94133210.5085953.6508751.2295540.1368282.9788230.5621280.5687180.6375880.0806060.1277150.054831100.0
75%49.05173916.9706176.72000410.37251111.3789103.9497511.4050080.1511903.4813130.6196860.6643431.1069090.0836030.1443840.057558100.0
max49.40260318.5467156.90984411.17527611.6197874.9609191.6030960.2358363.6355250.8233850.8211161.4402080.1074610.1658840.063402100.0
\n", "
" ], "text/plain": [ " SiO2 Al2O3 MgO CaO FeO Na2O \\\n", "count 10.000000 10.000000 10.000000 10.000000 10.000000 10.000000 \n", "mean 47.372314 16.205420 5.741570 9.981250 10.436615 3.779319 \n", "std 1.665998 1.183514 1.279253 0.740269 1.042155 0.592292 \n", "min 45.313339 14.539062 3.775658 8.926491 8.398151 3.177835 \n", "25% 45.888515 15.511612 4.770648 9.454504 9.799938 3.364238 \n", "50% 47.041178 15.831492 6.508831 9.941332 10.508595 3.650875 \n", "75% 49.051739 16.970617 6.720004 10.372511 11.378910 3.949751 \n", "max 49.402603 18.546715 6.909844 11.175276 11.619787 4.960919 \n", "\n", " K2O MnO TiO2 P2O5 CO2 H2O \\\n", "count 10.000000 10.000000 10.000000 10.000000 10.000000 10.000000 \n", "mean 1.225155 0.144397 2.945412 0.557252 0.567206 0.786400 \n", "std 0.278210 0.038657 0.600600 0.155661 0.174596 0.416988 \n", "min 0.697769 0.088899 1.776185 0.289823 0.290155 0.293341 \n", "25% 1.094556 0.133134 2.574574 0.526417 0.466633 0.491966 \n", "50% 1.229554 0.136828 2.978823 0.562128 0.568718 0.637588 \n", "75% 1.405008 0.151190 3.481313 0.619686 0.664343 1.106909 \n", "max 1.603096 0.235836 3.635525 0.823385 0.821116 1.440208 \n", "\n", " F S Cl total \n", "count 10.000000 10.000000 10.000000 10.0 \n", "mean 0.079962 0.122889 0.050053 100.0 \n", "std 0.014664 0.034545 0.013133 0.0 \n", "min 0.047654 0.068020 0.021157 100.0 \n", "25% 0.076888 0.095440 0.046920 100.0 \n", "50% 0.080606 0.127715 0.054831 100.0 \n", "75% 0.083603 0.144384 0.057558 100.0 \n", "max 0.107461 0.165884 0.063402 100.0 " ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "melt.describe()" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "name\n", "PI032-01-04 60.431599\n", "PI032-02-01 60.230499\n", "PI032-02-03 60.134102\n", "PI032-03-01 60.052002\n", "PI032-04-01 60.175400\n", "PI032-04-02 59.365799\n", "PI032-04-03 59.394402\n", "PI032-05-01 58.552601\n", "PI041-02-01 61.860100\n", "PI041-02-02 61.831001\n", "dtype: float32" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "olivine[[\"FeO\", \"MgO\"]].sum(axis=1)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "MagmaFrames have extra functionality for easy processing of geochemical data. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The *elements* and *weights* attributes store the names and atomic weights of all elements in the dataset as lists and Series:" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['SiO2',\n", " 'Al2O3',\n", " 'MgO',\n", " 'CaO',\n", " 'FeO',\n", " 'Na2O',\n", " 'K2O',\n", " 'MnO',\n", " 'TiO2',\n", " 'P2O5',\n", " 'CO2',\n", " 'H2O',\n", " 'F',\n", " 'S',\n", " 'Cl']" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "melt.elements" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "SiO2 60.084\n", "Al2O3 101.961\n", "MgO 40.304\n", "CaO 56.077\n", "FeO 71.844\n", "Na2O 61.979\n", "K2O 94.195\n", "MnO 70.937\n", "TiO2 79.865\n", "P2O5 141.943\n", "CO2 44.008\n", "H2O 18.015\n", "F 18.998\n", "S 32.065\n", "Cl 35.453\n", "dtype: float64" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "melt.weights" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "SiO2 60.084\n", "FeO 71.844\n", "MgO 40.304\n", "NiO 74.692\n", "MnO 70.937\n", "Al2O3 101.961\n", "CaO 56.077\n", "dtype: float64" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "olivine.weights" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Conversion to moles or cations is done via their respective attributes:" ] }, { "cell_type": "code", "execution_count": 11, "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", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
SiAlMgCaFeNaKMnTiPCHFSCltotal
name
PI032-04-010.4235660.1469140.0831950.0924040.0699650.0621270.0076320.0009620.0164390.0021040.0073570.0823670.0021380.0023370.0004931.0
PI032-04-020.4210170.1536070.0836550.0895010.0715790.0595830.0103420.0009920.0172050.0024550.0079140.0765390.0022870.0026720.0006511.0
PI041-02-020.4405560.1791540.0649940.0882470.0767890.0658760.0123310.0011640.0189210.0042600.0056800.0392120.0013520.0011430.0003221.0
PI041-03-010.4174930.1687240.0936110.1070720.0819200.0589630.0132730.0008630.0215580.0042470.0098970.0177820.0022850.0014790.0008341.0
PI041-03-030.4112830.1701870.0924390.1086790.0832460.0601410.0135190.0006830.0222770.0039790.0101750.0188370.0023460.0013520.0008541.0
PI041-05-040.4282130.1961650.0517830.0901600.0721930.0798500.0183540.0010470.0167520.0062560.0062360.0275740.0024850.0020380.0008961.0
PI041-05-060.4170890.1799910.0635690.0860350.0874160.0698240.0162660.0012780.0246030.0047200.0078640.0351610.0030570.0021600.0009671.0
PI041-07-010.4036270.1603850.0883770.0926410.0849730.0542270.0145020.0010810.0237420.0041970.0057050.0608330.0021220.0027360.0008531.0
PI041-07-020.4122260.1658640.0893940.0975290.0865520.0558860.0156810.0010280.0240300.0047130.0045920.0371470.0021030.0023770.0008791.0
PI052-01-020.4264920.1747570.0486980.0969060.0607650.0832170.0170350.0017280.0115610.0050510.0034270.0652410.0022650.0020630.0007931.0
\n", "
" ], "text/plain": [ " Si Al Mg Ca Fe Na \\\n", "name \n", "PI032-04-01 0.423566 0.146914 0.083195 0.092404 0.069965 0.062127 \n", "PI032-04-02 0.421017 0.153607 0.083655 0.089501 0.071579 0.059583 \n", "PI041-02-02 0.440556 0.179154 0.064994 0.088247 0.076789 0.065876 \n", "PI041-03-01 0.417493 0.168724 0.093611 0.107072 0.081920 0.058963 \n", "PI041-03-03 0.411283 0.170187 0.092439 0.108679 0.083246 0.060141 \n", "PI041-05-04 0.428213 0.196165 0.051783 0.090160 0.072193 0.079850 \n", "PI041-05-06 0.417089 0.179991 0.063569 0.086035 0.087416 0.069824 \n", "PI041-07-01 0.403627 0.160385 0.088377 0.092641 0.084973 0.054227 \n", "PI041-07-02 0.412226 0.165864 0.089394 0.097529 0.086552 0.055886 \n", "PI052-01-02 0.426492 0.174757 0.048698 0.096906 0.060765 0.083217 \n", "\n", " K Mn Ti P C H \\\n", "name \n", "PI032-04-01 0.007632 0.000962 0.016439 0.002104 0.007357 0.082367 \n", "PI032-04-02 0.010342 0.000992 0.017205 0.002455 0.007914 0.076539 \n", "PI041-02-02 0.012331 0.001164 0.018921 0.004260 0.005680 0.039212 \n", "PI041-03-01 0.013273 0.000863 0.021558 0.004247 0.009897 0.017782 \n", "PI041-03-03 0.013519 0.000683 0.022277 0.003979 0.010175 0.018837 \n", "PI041-05-04 0.018354 0.001047 0.016752 0.006256 0.006236 0.027574 \n", "PI041-05-06 0.016266 0.001278 0.024603 0.004720 0.007864 0.035161 \n", "PI041-07-01 0.014502 0.001081 0.023742 0.004197 0.005705 0.060833 \n", "PI041-07-02 0.015681 0.001028 0.024030 0.004713 0.004592 0.037147 \n", "PI052-01-02 0.017035 0.001728 0.011561 0.005051 0.003427 0.065241 \n", "\n", " F S Cl total \n", "name \n", "PI032-04-01 0.002138 0.002337 0.000493 1.0 \n", "PI032-04-02 0.002287 0.002672 0.000651 1.0 \n", "PI041-02-02 0.001352 0.001143 0.000322 1.0 \n", "PI041-03-01 0.002285 0.001479 0.000834 1.0 \n", "PI041-03-03 0.002346 0.001352 0.000854 1.0 \n", "PI041-05-04 0.002485 0.002038 0.000896 1.0 \n", "PI041-05-06 0.003057 0.002160 0.000967 1.0 \n", "PI041-07-01 0.002122 0.002736 0.000853 1.0 \n", "PI041-07-02 0.002103 0.002377 0.000879 1.0 \n", "PI052-01-02 0.002265 0.002063 0.000793 1.0 " ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "cations = melt.cations()\n", "cations" ] }, { "cell_type": "code", "execution_count": 12, "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", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
SiO2Al2O3MgOCaOFeONa2OK2OMnOTiO2P2O5CO2H2OFSCltotal
name
PI032-04-010.4986480.0864780.0979430.1087830.0823670.0365700.0044920.0011330.0193530.0012380.0086610.0484840.0025170.0027510.0005811.0
PI032-04-020.4960510.0904910.0985640.1054520.0843360.0351010.0060930.0011690.0202720.0014460.0093250.0450900.0026950.0031480.0007671.0
PI041-02-020.5185550.1054370.0765010.1038710.0903840.0387690.0072570.0013700.0222700.0025070.0066860.0230770.0015910.0013450.0003781.0
PI041-03-010.4807020.0971350.1077840.1232830.0943220.0339450.0076410.0009940.0248220.0024450.0113960.0102370.0026310.0017030.0009601.0
PI041-03-030.4745570.0981850.1066600.1253990.0960530.0346970.0078000.0007890.0257050.0022960.0117410.0108680.0027060.0015600.0009861.0
PI041-05-040.5122780.1173370.0619490.1078590.0863650.0477630.0109780.0012530.0200400.0037420.0074600.0164940.0029730.0024380.0010711.0
PI041-05-060.4924200.1062490.0750500.1015740.1032040.0412170.0096020.0015080.0290470.0027860.0092850.0207560.0036090.0025510.0011411.0
PI041-07-010.4732250.0940200.1036170.1086150.0996250.0317890.0085010.0012670.0278360.0024600.0066890.0356610.0024880.0032070.0010001.0
PI041-07-020.4791350.0963930.1039030.1133590.1006000.0324790.0091130.0011950.0279300.0027390.0053370.0215880.0024440.0027630.0010211.0
PI052-01-020.5154920.1056130.0588600.1171280.0734460.0502910.0102950.0020890.0139740.0030520.0041430.0394280.0027370.0024940.0009581.0
\n", "
" ], "text/plain": [ " SiO2 Al2O3 MgO CaO FeO Na2O \\\n", "name \n", "PI032-04-01 0.498648 0.086478 0.097943 0.108783 0.082367 0.036570 \n", "PI032-04-02 0.496051 0.090491 0.098564 0.105452 0.084336 0.035101 \n", "PI041-02-02 0.518555 0.105437 0.076501 0.103871 0.090384 0.038769 \n", "PI041-03-01 0.480702 0.097135 0.107784 0.123283 0.094322 0.033945 \n", "PI041-03-03 0.474557 0.098185 0.106660 0.125399 0.096053 0.034697 \n", "PI041-05-04 0.512278 0.117337 0.061949 0.107859 0.086365 0.047763 \n", "PI041-05-06 0.492420 0.106249 0.075050 0.101574 0.103204 0.041217 \n", "PI041-07-01 0.473225 0.094020 0.103617 0.108615 0.099625 0.031789 \n", "PI041-07-02 0.479135 0.096393 0.103903 0.113359 0.100600 0.032479 \n", "PI052-01-02 0.515492 0.105613 0.058860 0.117128 0.073446 0.050291 \n", "\n", " K2O MnO TiO2 P2O5 CO2 H2O \\\n", "name \n", "PI032-04-01 0.004492 0.001133 0.019353 0.001238 0.008661 0.048484 \n", "PI032-04-02 0.006093 0.001169 0.020272 0.001446 0.009325 0.045090 \n", "PI041-02-02 0.007257 0.001370 0.022270 0.002507 0.006686 0.023077 \n", "PI041-03-01 0.007641 0.000994 0.024822 0.002445 0.011396 0.010237 \n", "PI041-03-03 0.007800 0.000789 0.025705 0.002296 0.011741 0.010868 \n", "PI041-05-04 0.010978 0.001253 0.020040 0.003742 0.007460 0.016494 \n", "PI041-05-06 0.009602 0.001508 0.029047 0.002786 0.009285 0.020756 \n", "PI041-07-01 0.008501 0.001267 0.027836 0.002460 0.006689 0.035661 \n", "PI041-07-02 0.009113 0.001195 0.027930 0.002739 0.005337 0.021588 \n", "PI052-01-02 0.010295 0.002089 0.013974 0.003052 0.004143 0.039428 \n", "\n", " F S Cl total \n", "name \n", "PI032-04-01 0.002517 0.002751 0.000581 1.0 \n", "PI032-04-02 0.002695 0.003148 0.000767 1.0 \n", "PI041-02-02 0.001591 0.001345 0.000378 1.0 \n", "PI041-03-01 0.002631 0.001703 0.000960 1.0 \n", "PI041-03-03 0.002706 0.001560 0.000986 1.0 \n", "PI041-05-04 0.002973 0.002438 0.001071 1.0 \n", "PI041-05-06 0.003609 0.002551 0.001141 1.0 \n", "PI041-07-01 0.002488 0.003207 0.001000 1.0 \n", "PI041-07-02 0.002444 0.002763 0.001021 1.0 \n", "PI052-01-02 0.002737 0.002494 0.000958 1.0 " ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "moles = melt.moles()\n", "moles" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "the *units* attribute shows the data type and units:" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "('oxide wt. %', 'cation mol fraction', 'oxide mol fraction')" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "melt.units, cations.units, moles.units" ] } ], "metadata": { "kernelspec": { "display_name": "py310", "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.10.13" } }, "nbformat": 4, "nbformat_minor": 2 }