- MNE version: 1.3.1
- operating system: macOS Ventura
Hi everyone, I’m trying to read EEG data from a csv file but I’m having a problem with the units, even after applying a solution described here on the forum << raw.apply_function(lambda x: x * 1e-6) >> . When plotting raw, the unit of microvolts appears in the upper right corner.
Here is my code:
file_name = 'example.csv'
data = pd.read_csv(file_name, skiprows=0, usecols=[*range(2, 18)])
channel_names = ['FP1', 'FP2', 'F3', 'F4', 'FC1', 'FC2', 'C4', 'C3', 'Cz', 'CP2', 'CP1', 'P4', 'Pz', 'P3', 'O2', 'O1']
sample_frequency = 512
info = mne.create_info(ch_names= channel_names, sfreq= sample_frequency, ch_types='eeg')
raw = mne.io.RawArray(data.transpose(), info)
raw.apply_function(lambda x: x * 1e-6)
raw.plot( scalings = 'auto' )
plt.show()
Thank you very much in advance.