Open mayankchetan opened 1 month ago
Thanks, I can see how that can be a problem. The formula is indeed evaluated on the whole dataframe (df) before the mask is applied: https://github.com/ebranlard/pyDatView/blob/4140c241cb3632cc4482e814d233794a9b019d60/pydatview/formulae.py#L16
The mask is applied when the "columns" are retrieved: https://github.com/ebranlard/pyDatView/blob/4140c241cb3632cc4482e814d233794a9b019d60/pydatview/Tables.py#L874
There is likely a better way to apply a mask to a pandas dataframe without duplicating the memory, but it might require some changes.
Currently, I don't see an easy path forward, but some workaround:
Y-centering = "mean=0"
) doesn't remove the "masked-mean".
When creating new calculated channels after masking the data (eg:
{B1TipTDxr} - np.mean({B1TipTDxr})
), the value ofnp.mean({B1TipTDxr})
is calculated from the whole time history.Eg: This can affect removing means from simulations which have long transients.