flasc.utilities.energy_ratio_utilities.add_ws#
- flasc.utilities.energy_ratio_utilities.add_ws(df_, ws_cols, remove_all_nulls=False)[source]#
Add the ws column to a dataframe, given which columns to average over.
- Return type:
DataFrame
- 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