mmcci.sc.multiply_non_zero_values
- mmcci.sc.multiply_non_zero_values(dataframes, strict=False)[source]
Multiply non-zero values across a list of pandas DataFrames.
Args: dataframes (list): A list of pandas DataFrames with the same shape and column/row names. strict (bool) (optional): If True, only interactions where more than 50% of the values are non-zero will be multiplied. Defaults to False.
- Returns:
A new DataFrame where each cell contains the product of non-zero values or zero if more than 50% of the values in the corresponding cells are zero.
- Return type:
pd.DataFrame