elphick.mass_composition.utils.pd_utils.composition_to_mass

elphick.mass_composition.utils.pd_utils.composition_to_mass(df, mass_wet='mass_wet', mass_dry='mass_dry')[source]

Convert a composition Dataframe to mass

Parameters:
  • df (DataFrame) – The pd.DataFrame containing mass_wet, mass+_dry and composition columns. H2O if provided will be dropped. All columns other than the mass_wet and mass_dry are assumed to be additive, that is, dry mass weighting is valid. Assumes composition is in %w/w units.

  • mass_wet (str) – The wet mass column, not optional. Consider solve_mass_moisture prior to this call if needed.

  • mass_dry (str) – The dry mass column, not optional. Consider solve_mass_moisture prior to this call if needed.

Return type:

DataFrame

Returns:

A pd.Dataframe containing mass for all components