Skip to content

domain_change builtin

domain_change(
    before,
    after,
    *,
    weights=None,
    density=None,
    grades=None,
    scheme=None,
    data=None,
)

Tonnage, and with grades metal, moving between the classes of two categorical models of the same blocks, such as an old and a new domain model, or the most likely category and a simulated realization.

Parameters:

Name Type Description Default
before array_like or str

Class of each block in each model, or their columns in data; null or NaN leaves the block out. With scheme, numbers are its codes and labels are encoded by it; without, labels of either model, in the order of Categories.from_values.

required
after array_like or str

Class of each block in each model, or their columns in data; null or NaN leaves the block out. With scheme, numbers are its codes and labels are encoded by it; without, labels of either model, in the order of Categories.from_values.

required
weights array_like or str

Volume of each block; default the volumes of a BlockModel data, else 1.

None
density (float, array_like or str)

Density of each block; default 1.

None
grades array_like or str

Grade of each block; adds mean_grade and metal. NaN grades add tonnage but no metal.

None
scheme Categories

Names and order of the classes.

None
data (PointSet, BlockModel, Table or dict)

Where column names are looked up.

None

Returns:

Type Description
Table

One row per pair of classes, from then to in class order: from, to, tonnage (weights × density), and with grades mean_grade (null without tonnage) and metal. Summing tonnage over to gives each class of before, over from each class of after; rows with from == to hold what is unchanged.

used in