Hi there,
I’m using macOS Catalina 10.15.7 and MNE 0.23.4
I am trying to average every 5 trials for each of the two conditions I have in my data after preprocessing to subsequently use in MVPA (based off Grootswagers et al., 2017) .
I have “AUD_Left” and “AUD_Right” conditions, each with N instances after equalising epochs.
The appearance AUD_Left and AUD_Right is random throughout the session.
I would like to average every 5 instances within a condition, so that I end up with N ÷ 5 instances of each condition after averaging.
Currently;
epochs_from_file
Number of events 190
Events AUD_Left: 95
AUD_Right: 95
Time range -0.500 – 0.998 sec
Baseline -0.500 – -0.200 sec
X = epochs_from_file.get_data()
X.shape
(190, 64, 768)
y = epochs_from_file.events
y
array([216, 216, 216, 203, 203, 216, 203, 216, 216, 203, 216, 203, 203,
203, 216, 203, 216, 203, 203, 203, 203, 203, 216, 216, 216, 216,
216, 203, 216, 216, 216, 203, 203, 203, 216, 203, 203, 216, 203,
216, 216, 216, 203, 203, 216, 203, 203, 216, 203, 216, 203, 203,
203, 203, 216, 203, 216, 216, 216, 216, 203, 216, 216, 216, 216,
203, 203, 203, 203, 216, 216, 203, 216, 203, 216, 216, 216, 216,
203, 203, 216, 203, 216, 203, 203, 216, 216, 203, 203, 216, 216,
203, 203, 203, 216, 203, 216, 203, 216, 203, 216, 216, 203, 216,
216, 216, 203, 203, 203, 203, 216, 216, 203, 216, 216, 203, 203,
203, 216, 216, 216, 216, 203, 203, 203, 216, 203, 216, 216, 216,
203, 203, 203, 203, 203, 216, 203, 203, 216, 203, 216, 203, 216,
216, 203, 216, 216, 216, 203, 203, 216, 203, 216, 203, 203, 203,
203, 203, 216, 203, 216, 203, 203, 216, 203, 216, 216, 203, 203,
216, 216, 216, 216, 216, 216, 216, 216, 216, 203, 203, 216, 203,
216, 203, 203, 203, 203, 203, 216, 216], dtype=int32)
I’d like to average (not sliding window) every 5 instances of event 216 and 203 separately, so that afterwards;
X.shape
(38, 64, 768)
I hope that is clear and I’m sorry if this is very simple, I haven’t been able to find any solution so far!
Cheers,
Yohan