flasc.utilities.energy_ratio_utilities.add_ws

Contents

flasc.utilities.energy_ratio_utilities.add_ws#

flasc.utilities.energy_ratio_utilities.add_ws(df_: DataFrame, ws_cols: List[str], remove_all_nulls: bool = False) DataFrame[source]#

Add the ws column to a dataframe, given which columns to average over.

Parameters:
  • df (pl.DataFrame) -- The Polars DataFrame containing the column to bin.

  • ws_cols (list(str)) -- The name of the columns to average across.

  • remove_all_nulls (bool) -- (bool): Remove all null values in ws_cols (rather than any)

  • df_ (DataFrame)

Returns:

A new Polars DataFrame with an additional ws column

Return type:

pl.DataFrame