elphick.mass_composition.utils.pd_utils.mass_to_composition

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

Convert a mass DataFrame to composition

Parameters:
  • df (DataFrame) – The pd.DataFrame containing mass. H2O if provided will be ignored. 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 (wet and dry mass) and composition