directory = '/Users/cinthia/UO/Coding/PD_offmeds'
for dirpath, dirnames, filenames in os.walk(directory):
for filename in filenames:
if filename.endswith('.fif'):
with open(os.path.join(dirpath, filename)) as f:
print(f.read())
Hi everyone, I’m trying to load multiple eeg .fif files to my code so I can further analyze them all without having to code for all of them separately. I am trying out this code but I get this error:
UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xff in position 33: invalid start byte
Does anyone know what the problem is or if there is any other, easier, way to upload all my files for further analysis?
from pathlib import Path
directory = Path("/Users/cinthia/UO/Coding/PD_offmeds")
raw_paths = directory.rglob("*.fif")
for raw_path in raw_paths:
raw = mne.io.read_raw(raw_path)
...