Dear MNE Experts,
I am working with an EpochsArray
object that contains different event_id
categories. However, I encountered an issue when trying to apply a z-score transformation to the data corresponding to each specific event_id
. Below is a description of the problem:
Epoch Structure
<EpochsArray | 278 events (all good), -0.5 – 2 s, baseline off, ~32.0 MB, data loaded,
'1': 34
'2': 34
'3': 36
'4': 37
'5': 33
'6': 37
'7': 33
'8': 34>
Working Example
When applying a moving average transformation across all data in the EpochsArray
, it works perfectly:
for i_shape1 in range(epoch._data.shape[0]):
epoch._data[i_shape1,:,:] = JY_basic_func.moving_average(epoch._data[i_shape1,:,:] , np.ones(window) / window)
Problematic Code
However, when I attempt to apply a z-score transformation to each event_id
subset using the following code, the data inside epoch[i_key]._data
does not update:
for i_key in epoch.event_id.keys():
if z_type =='channel':
epoch[i_key]._data = zscore(epoch[i_key]._data,axis=1)
After running this, epoch[i_key]._data
remains unchanged.
Question
Is there a convenient way to modify the data corresponding to each event_id
within an EpochsArray
structure? Any suggestions or guidance would be greatly appreciated.
System Information:
- MNE version: e.g. 1.5.1
- operating system: e.g. Windows 10
Thank you for your time and support!
Best regards,
Jianyang