Then, I can get epoched data using
epoched_data = epochs.get_data()
epoched_data (1531, 19, 250)
I want to do some signal processing with epoched_data, but I do not know how to push back epoched_data to the original epochs structure. Is there any function like epochs.set_data()?
Hello, sorry, that was a typo; of course, the correct call is epochs.apply_function(…)
The trick here is that you pass a function to apply_function; this function will retrieve the data, can apply transformations, and needs to return the transformed data. Then, apply_function will take this result and replace the existing data in epochs with the transformed data. That way, you don’t have to manually first extract the data, transform it, and then somehow squeeze it back into your epochs (which is what you’ve been trying to do so far — it’s error-prone and can be difficult!)
I’m afraid currently there are no examples for this method in our documentation, but the API docs I linked to above should contain all the information you need.