flasc.utilities.energy_ratio_utilities.add_wd

Contents

flasc.utilities.energy_ratio_utilities.add_wd#

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

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

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