qis.df_nansum_clip

qis.df_nansum_clip(df, a_min=None, a_max=None, is_min_max_clip_fill=True, axis=1)[source]

sum of finite entries along axis, after clipping the data to [a_min, a_max]

Parameters:
  • df (DataFrame) – values to aggregate. Non-finite entries are skipped, not treated as zero

  • a_min (float | None) – lower bound. None applies no lower bound

  • a_max (float | None) – upper bound. None applies no upper bound

  • is_min_max_clip_fill (bool) – True replaces an entry outside the bounds with the bound it breached; False drops it, so it does not enter the aggregate at all

  • axis (Literal[0, 1]) – 0 collapses the rows and returns a Series indexed by df.columns; 1 collapses the columns and returns a Series indexed by df.index

Returns:

the aggregate of the clipped values along axis, named 'nansum_clip'

Raises:

ValueError – if axis is not 0 or 1

Return type:

Series