Interval Data - Sink Float

Intervals are encountered in Metallurgy, aka fractions, e.g. size fractions. In that case the typical nomenclature is size_retained, size passing, since the data originates from a sieve stack.

The Sink Float metallurgical test splits/fractionates samples by density. The density fraction is often conducted by size fraction, resulting in 2D fractionation (interval) data.

import logging
from functools import partial
from pathlib import Path

import pandas as pd
# noinspection PyUnresolvedReferences
import numpy as np
import plotly

from elphick.mass_composition import MassComposition
from elphick.mass_composition.datasets import datasets
from elphick.mass_composition.datasets.sample_data import size_by_assay
from elphick.mass_composition.flowsheet import Flowsheet
from elphick.mass_composition.utils.partition import napier_munn
logging.basicConfig(level=logging.INFO,
                    format='%(asctime)s %(levelname)s %(module)s - %(funcName)s: %(message)s',
                    datefmt='%Y-%m-%dT%H:%M:%S%z')

Load Data

We load some real data.

df_data: pd.DataFrame = datasets.load_nordic_iron_ore_sink_float()
df_data
size_retained size_passing density_lo density_hi mass_pct Fe SiO2 P TiO2 V
0 1.000 NaN NaN NaN 0.4 22.7 50.9 0.042 0.170 0.0049
1 0.100 1.000 NaN NaN 67.1 27.3 47.7 0.107 0.178 0.0062
2 0.063 0.100 NaN NaN 12.7 18.0 57.8 0.440 0.200 0.0056
3 0.040 0.063 NaN NaN 8.2 16.9 57.1 0.610 0.235 0.0057
4 0.000 0.040 NaN NaN 11.6 19.4 51.6 0.650 0.310 0.0072
5 0.100 NaN NaN 2.7 54.2 1.2 1.6 0.180 0.084 0.0030
6 0.100 NaN 2.7 3.3 9.7 16.6 42.6 0.980 0.380 0.0100
7 0.100 NaN 3.3 NaN 36.1 68.0 78.8 0.033 0.285 0.0120
8 0.063 0.100 NaN 2.7 24.0 1.2 79.5 0.015 0.060 0.0070
9 0.063 0.100 2.7 3.3 11.9 10.2 54.0 2.320 0.280 0.0080
10 0.063 0.100 3.3 NaN 64.1 67.1 1.4 0.174 0.530 0.0020
11 0.040 0.063 NaN 2.7 76.6 3.1 71.3 0.850 0.145 0.0130
12 0.040 0.063 2.7 3.3 4.3 28.5 24.5 2.780 0.460 0.1100
13 0.040 0.063 3.3 NaN 19.1 68.6 0.6 0.069 0.480 0.0130


The dataset contains size x assay, plus size x density x assay data. We’ll drop the size x assay data to leave the sink / float data.

# df_sink_float: pd.DataFrame = df_data.query('density_lo != np.nan and density_hi != np.nan')
# df_sink_float

Total running time of the script: ( 0 minutes 0.346 seconds)

Gallery generated by Sphinx-Gallery