.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/examples/02_interval_sample/03_incremental_separation.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_examples_02_interval_sample_03_incremental_separation.py: Incremental Separation ====================== This method sorts by the provided direction prior to incrementally removing and discarding the first fraction (of the remaining fractions) and recalculating the mass-composition and recovery of the portion remaining. This is equivalent to incrementally applying a perfect separation (partition) at every interval edge. The returned data can be used to assess the amenability of a fractionated sample (in the dimension of the sample). This concept is only applicable in a single dimension where the mass-composition (sample) object is an interval index. The example will use a dataset that represents a sample fractionated by size. .. GENERATED FROM PYTHON SOURCE LINES 16-24 .. code-block:: Python import logging import pandas as pd import plotly from elphick.geomet import IntervalSample from elphick.geomet.datasets.sample_data import size_by_assay .. GENERATED FROM PYTHON SOURCE LINES 25-28 .. code-block:: Python logging.basicConfig(level=logging.INFO, format='%(asctime)s %(levelname)s %(module)s - %(funcName)s: %(message)s', datefmt='%Y-%m-%dT%H:%M:%S%z') .. GENERATED FROM PYTHON SOURCE LINES 29-33 Create the sample ----------------- The sample is a MassComposition object .. GENERATED FROM PYTHON SOURCE LINES 33-37 .. code-block:: Python df_data: pd.DataFrame = size_by_assay() df_data .. raw:: html
mass_dry fe sio2 al2o3
size_retained size_passing
0.850 2.000 3.3 64.15 2.04 2.68
0.500 0.850 9.9 64.33 2.05 2.23
0.150 0.500 26.5 64.52 1.84 2.19
0.075 0.150 2.5 62.65 2.88 3.32
0.045 0.075 8.8 62.81 2.12 2.25
0.000 0.045 49.0 55.95 6.39 6.34


.. GENERATED FROM PYTHON SOURCE LINES 38-39 The size index is of the Interval type, maintaining the fractional information. .. GENERATED FROM PYTHON SOURCE LINES 39-43 .. code-block:: Python mc_size: IntervalSample = IntervalSample(df_data, name='Sample', moisture_in_scope=False) mc_size.data .. raw:: html
mass_dry Fe SiO2 Al2O3
size
[0.85, 2.0) 3.3 64.15 2.04 2.68
[0.5, 0.85) 9.9 64.33 2.05 2.23
[0.15, 0.5) 26.5 64.52 1.84 2.19
[0.075, 0.15) 2.5 62.65 2.88 3.32
[0.045, 0.075) 8.8 62.81 2.12 2.25
[0.0, 0.045) 49.0 55.95 6.39 6.34


.. GENERATED FROM PYTHON SOURCE LINES 44-49 Incrementally Separate ---------------------- Leverage the method to return the incremental perfect separation in the size dimension. Here we will "de-slime" by discarding the smallest (lowest) sizes incrementally. .. GENERATED FROM PYTHON SOURCE LINES 49-53 .. code-block:: Python results: pd.DataFrame = mc_size.ideal_incremental_separation(discard_from="lowest") results .. raw:: html
mass_dry Fe SiO2 Al2O3
size_cut-point attribute
0.850 composition 3.300 64.150000 2.040000 2.680000
0.500 composition 13.200 64.285000 2.047500 2.342500
0.150 composition 39.700 64.441864 1.908992 2.240705
0.075 composition 42.200 64.335711 1.966517 2.304645
0.045 composition 51.000 64.072451 1.993000 2.295216
0.000 composition 100.000 60.092450 4.147530 4.277160
0.850 recovery 0.033 0.035228 0.016231 0.020677
0.500 recovery 0.132 0.141209 0.065164 0.072293
0.150 recovery 0.397 0.425734 0.182728 0.207979
0.075 recovery 0.422 0.451798 0.200088 0.227385
0.045 recovery 0.510 0.543778 0.245069 0.273677
0.000 recovery 1.000 1.000000 1.000000 1.000000


.. GENERATED FROM PYTHON SOURCE LINES 54-55 Repeat the process but by discarding the coarser sizes. .. GENERATED FROM PYTHON SOURCE LINES 55-59 .. code-block:: Python results_2: pd.DataFrame = mc_size.ideal_incremental_separation(discard_from="highest") results_2 .. raw:: html
mass_dry Fe SiO2 Al2O3
size_cut-point attribute
2.000 composition 100.000 60.092450 4.147530 4.277160
0.850 composition 96.700 59.953981 4.219452 4.331665
0.500 composition 86.800 59.454873 4.466889 4.571371
0.150 composition 60.300 57.228905 5.621327 5.617910
0.075 composition 57.800 56.994429 5.739896 5.717301
0.045 composition 49.000 55.950000 6.390000 6.340000
2.000 recovery 1.000 1.000000 1.000000 1.000000
0.850 recovery 0.967 0.964772 0.983769 0.979323
0.500 recovery 0.868 0.858791 0.934836 0.927707
0.150 recovery 0.603 0.574266 0.817272 0.792021
0.075 recovery 0.578 0.548202 0.799912 0.772615
0.045 recovery 0.490 0.456222 0.754931 0.726323


.. GENERATED FROM PYTHON SOURCE LINES 60-62 Plot Grade-Recovery ------------------- .. GENERATED FROM PYTHON SOURCE LINES 62-67 .. code-block:: Python fig = mc_size.plot_grade_recovery(target_analyte='Fe') fig.update_layout(height=800) fig .. raw:: html


.. GENERATED FROM PYTHON SOURCE LINES 68-69 Discard the highest (coarsest) sizes. As expected the response differs. .. GENERATED FROM PYTHON SOURCE LINES 69-73 .. code-block:: Python fig = mc_size.plot_grade_recovery(target_analyte='Fe', discard_from="highest") fig.update_layout(height=800) .. raw:: html


.. GENERATED FROM PYTHON SOURCE LINES 74-83 Plot Amenability ---------------- The Amenability Index (AI) will generally range between zero and one, but can in fact be legitimately negative. The closer the AI is to 1.0, the more amenable the ore is to separation of that particular gangue component relative to the target analyte. The AI is shown in the legend (in brackets). The plot below suggests that SiO2 is marginally more amenable than Al2O3 across the spectrum of yield for this sample. .. GENERATED FROM PYTHON SOURCE LINES 83-89 .. code-block:: Python fig = mc_size.plot_amenability(target_analyte='Fe') fig.update_layout(height=800) # noinspection PyTypeChecker plotly.io.show(fig) .. raw:: html :file: images/sphx_glr_03_incremental_separation_001.html .. GENERATED FROM PYTHON SOURCE LINES 90-93 Discard the highest (coarsest) sizes. As expected the response differs. The Amenability indices are negative indicating a downgrade, rather than an upgrade. This demonstrates that desliming is a plausible pathway to beneficiating this sample, while "coarse scalping" is not. .. GENERATED FROM PYTHON SOURCE LINES 93-97 .. code-block:: Python fig = mc_size.plot_amenability(target_analyte='Fe', discard_from="highest") fig.update_layout(height=800) fig .. raw:: html


.. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 8.581 seconds) .. _sphx_glr_download_auto_examples_examples_02_interval_sample_03_incremental_separation.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: 03_incremental_separation.ipynb <03_incremental_separation.ipynb>` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: 03_incremental_separation.py <03_incremental_separation.py>` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_