The saved.fif file cannot be read

Please help me. I met some problem such as :

No raw data in D:\PycharmProjects\pythonProjects\python-MNE\vscodePythonMne\noPain_ave.fif

So first I did something like this

And then:


When I use the save() function to save it, then either "scipy.io. Loadmat "or “mne.io. Read raw fif(“noPain ave.fif”)” cannot be read successfully, so that further analysis cannot be done.

It would be great if you have a tutorial like this, or I will give you my data and code.

I would appreciate it if you could help me

mne.io.read_raw_fif() can only read FIFF files containing raw data, not HDF5 files containing evoked data.

When saving your evoked files, they should have an _ave.fif suffix, i.e. you’ll want to do

evoked_fname = 'pain_ave' + str(count + 1) + '_ave.fif'
pain_evoked.save(evoked_fname)

The evoked data can then be read back via

pain_evoked_read = mne.read_evokeds(evoked_fname, 0)

Best wishes,
Richard

thank you!
But I have a question:
After averaging the epochs of the two conditions, how can I save them locally and then draw their ERPs

This should help:

https://mne.tools/stable/auto_tutorials/evoked/20_visualize_evoked.html

How do I save a.fif file as.h5

Please open a new thread for new questions, thank you.