elphick.geomet.sample.Sample
- class elphick.geomet.sample.Sample(data=None, name=None, moisture_in_scope=True, mass_wet_var=None, mass_dry_var=None, moisture_var=None, component_vars=None, composition_units='%', components_as_symbols=True, ranges=None, config_file=None)[source]
 - __init__(data=None, name=None, moisture_in_scope=True, mass_wet_var=None, mass_dry_var=None, moisture_var=None, component_vars=None, composition_units='%', components_as_symbols=True, ranges=None, config_file=None)[source]
 - Parameters:
 data (
Optional[DataFrame]) – The input dataname (
Optional[str]) – The name of the samplemoisture_in_scope (
bool) – Whether the moisture is in scope. If False, only dry mass is processed.mass_wet_var (
Optional[str]) – The name of the wet mass columnmass_dry_var (
Optional[str]) – The name of the dry mass columnmoisture_var (
Optional[str]) – The name of the moisture columncomponent_vars (
Optional[list[str]]) – The names of the chemical columnscomponents_as_symbols (
bool) – If True, convert the composition variables to symbols, e.g. Feranges (
Optional[dict[str,list]]) – The range of valid data for each column in the dataconfig_file (
Optional[Path]) – The configuration file
Methods
__init__([data, name, moisture_in_scope, ...])add(other[, name, include_supplementary_data])Add two objects together
balance_composition([epsilon])Balance the composition data
clip_composition([ranges, epsilon])Clip the components
clip_recovery(other[, recovery_bounds, ...])Clip the recovery to the specified bounds and recalculate the estimate.
compare(other[, comparisons, explicit_names])create_congruent_object(name[, ...])Create an object with the same attributes
div(other[, name, include_supplementary_data])Divide two objects
filter_by_index(index)Update the data by index
from_mass_dataframe(mass_df[, mass_wet, ...])Class method to create a MassComposition object from a mass dataframe.
get_mass_data([include_moisture])Get the mass data
plot_comparison(other[, color, ...])Create an interactive parallel plot
plot_parallel([color, vars_include, ...])Create an interactive parallel plot
plot_ternary(variables[, color, title])Plot a ternary diagram
query(expr[, name])Reduce the data by a query expression
reset_index(index_name)set_moisture(moisture[, mass_to_adjust])Set the moisture to the specified value
split(fraction[, name_1, name_2, ...])Split the object by mass
sub(other[, name, include_supplementary_data])Subtract other from self
to_stream()update_mass_data(value)weight_average([group_by])Attributes
aggregatecomposition_columnsdatadata_columnsmass_columnsmass_datamoisture_columnsupplementary_columnsvariable_mapA map from lower case standard names to the actual column names