a quick function to update epoch data?

External Email - Use Caution

Hi List,

Is there a function to push in scaled/modified EEG data into the epoch
object.
That is,
data = epoch.get_data()
data = 10*data - 20

Can I next push back data into the epoch object using a function call?

I do this is by creating a new epoch object!
But I am sure there will be a more straightforward way which I am missing.

Best regards,
Neeraj
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200205/295dd85e/attachment.html

External Email - Use Caution

the clean way would be to use EpochsArray

https://mne.tools/stable/generated/mne.EpochsArray.html
https://mne.tools/stable/auto_examples/io/plot_objects_from_arrays.html#sphx-glr-auto-examples-io-plot-objects-from-arrays-py

another less clean way is to do:

epochs._data[:] = data

assuming the epochs are with preload=True

Alex