applying the function only to selected events.

I have a problem applying the function only to selected events. I have several events (addition, subtraction, rest) . I need to leave the hemoglobin values in the addition event unchanged, but in other events randomly mix the hemoglobin values. Tell me if there is a function that will apply only to the specified events

If you pass an event_id dict when you create Epochs, then you can do something like:

epochs_addition_untouched = epochs['addition']
epochs_rest_scrambled = epochs['rest'].apply_function(some_function_you_wrote)

But in this case the epochs for the different events will be in separate variables. You could recombine them with mne.concatenate_epochs but then the order would change (maybe this doesn’t matter to you?). Unfortunately epochs.apply_function does not have a way to provide a selection of which epochs should have the function applied.