I have a list with 3-6 channels, as a multidimensional list/array. I want to zscore normalize all channels of the data, but it is important that the scaling factor is the same for all channels because the difference in mean between channels is important for my application. I have taken a look at:
https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.zscore.html
including the source code but I am not sure if it normalizes the channels individually or together. Is it possible to use scipy zscore for what I am trying to do?
Don't use the
zscorefunctionIt does do each channel independently, as you suspected.
Do it manually
In a 2D array,
numpydefaults to averaging and SD'ing across the entire 2D dataset, which makes it easy to do this manually.Here is an example with 3 channels.