Protomix.region_removal

region_removal(spectra_df: DataFrame, range=(4.5, 6.1)) DataFrame[source]

Zero out a specified ppm range in each spectrum within the DataFrame.

This function sets the values within a specified ppm range to zero for each spectrum in the DataFrame, effectively removing that region from the spectra.

Parameters:
  • spectra_df (pd.DataFrame) – A DataFrame where each row represents a spectrum and columns correspond to ppm values.

  • range (tuple) – A tuple specifying the start and end ppm values of the region to be zeroed out. Default is (4.5, 6.1).

Returns:

An updated DataFrame with the specified ppm range zeroed out, retaining the original indexes.

Return type:

pd.DataFrame