Protomix.window_selection

window_selection(spectra_df: DataFrame, range=(0.2, 10)) DataFrame[source]

Extract a specified ppm range from the spectra_df DataFrame.

This function extracts the spectral data within a specified ppm range from each spectrum in the DataFrame. The resulting DataFrame retains the original indexes but only includes the selected ppm range.

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 extract. Default is (0.2, 10).

Returns:

A DataFrame containing only the spectral data within the specified ppm range, retaining the original indexes.

Return type:

pd.DataFrame