Hi, I’m trying to use MNE for time-frequency analysis. My data is in .cfs form and it is collected using Signal. I’m trying to figure out the best way to import my data in a usable way. Will it work just with this file type? Do I need to somehow change the file type? I can export it as .txt or .mat as well.
Pass a list of the channel names, a list of the channel types (e.g. “eeg”), and the sampling frequency, to mne.create_info
Get your data into a numpy array. If you export your data to .mat format, you may be able to use pymatreader for this. Just make sure your numpy array has a shape (n_channels, n_samples).
pass the info object you created in step 1, and the numpy array to mne.io.RawArray
Thanks for the help. If I may ask, how can I change my numpy array shape? the current shape is (samples[450641], channels[11]) and I can’t seem to reshape it using
Make sure you are assigning the transposed array back into a variable, like I did above. Numpy doesn’t modify your array “in-place”, it always returns a copy.
EDIT: I probably shouldn’t say always copies, I just mean that when you do my_array.T or my_array.reshape(...), the result is not persistent, so you need to pass that result into some variable.