Skip to content

Table

Columnar attribute table; exchanges data with pyarrow, polars and pandas through the Arrow PyCapsule interface.

units property

units

Units of the columns that have one, kept in the Arrow field metadata and through Parquet.

convert_units method descriptor

convert_units(column, *, to)

New table with column converted to unit to, a unit of the same kind (see with_units): a grade never converts to a ratio, nor metal to ore mass, nor one currency to another. The column must have a unit.

drop_null

drop_null(*columns)

Rows with a value in every one of columns, all columns by default.

filter method descriptor

filter(mask)

Rows where mask is true.

with_column method descriptor

with_column(name, values, *, unit=None)

New table with the column name added or replaced: numbers (NaN is null) or text (None is null), in unit or else the unit values carries.

with_columns method descriptor

with_columns(data)

New table with the columns of data, a dict or table, added or replaced.

with_units method descriptor

with_units(units)

New table with the units of units, column name to unit; None removes one. Replacing a column's values drops its unit.

A unit combines lengths (m, cm, km, ft, ...), masses (t, kt, Mt, g, kg, oz troy, lb, st short ton), grades (g/t, ppm, ppb, %, kg/t, oz/t as troy ounces per short ton, lb/st), ratios (ratio, ratio%), angles (deg, rad) and currencies (USD, BRL, EUR, CAD, AUD, with k and M) with *, /, ^n and parentheses: t/m3, USD/m, (g/t)^2. kg metal is a mass of metal, never of ore. An unknown unit raises InvalidInput.

used in