qis.df_nanmean_weighted¶
- qis.df_nanmean_weighted(df, weights, axis=1)[source]¶
weighted average across axis, with weights rescaled at each line to sum to one over the finite entries only: mu_t = sum_i w_i x_ti / sum_i w_i 1{x_ti finite}. a line with no finite data, or whose finite entries all carry zero weight, returns nan. axis=1 -> weights indexed by df.columns, result indexed by df.index axis=0 -> weights indexed by df.index, result indexed by df.columns