flasc.utilities.energy_ratio_utilities.add_wd#
- flasc.utilities.energy_ratio_utilities.add_wd(df_, wd_cols, remove_all_nulls=False)[source]#
Add the wd 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.
wd_cols (list(str)) -- The name of the columns to average across.
remove_all_nulls (bool) -- (bool): Remove all null values in wd_cols (rather than any)
df_ (DataFrame)
- Returns:
A new Polars DataFrame with an additional wd column
- Return type:
pl.DataFrame