diff --git a/doc/changes/dev/13415.bugfix.rst b/doc/changes/dev/13415.bugfix.rst new file mode 100644 index 00000000000..371e426a3ed --- /dev/null +++ b/doc/changes/dev/13415.bugfix.rst @@ -0,0 +1 @@ +Fixed a bug where ``mne.io.read_raw_gdf`` failed with NumPy ≥1.24 due to the removal of ``np.fromstring`` binary mode. Replaced with ``np.frombuffer`` for compatibility. (:newcontrib:`devparikh0506`) \ No newline at end of file diff --git a/doc/changes/names.inc b/doc/changes/names.inc index 38c240d69d7..fbbe285720b 100644 --- a/doc/changes/names.inc +++ b/doc/changes/names.inc @@ -65,6 +65,7 @@ .. _David Sabbagh: https://github.com/DavidSabbagh .. _Demetres Kostas: https://github.com/kostasde .. _Denis Engemann: https://denis-engemann.de +.. _Dev Parikh: https://github.com/devparikh0506 .. _Dinara Issagaliyeva: https://github.com/dissagaliyeva .. _Diptyajit Das: https://github.com/dasdiptyajit .. _Dirk Gütlin: https://github.com/DiGyt diff --git a/mne/io/edf/edf.py b/mne/io/edf/edf.py index 763ef4f91eb..83e66b9f9c6 100644 --- a/mne/io/edf/edf.py +++ b/mne/io/edf/edf.py @@ -1441,9 +1441,9 @@ def _read_gdf_header(fname, exclude, include=None): edf_info["data_offset"] + edf_info["n_records"] * edf_info["bytes_tot"] ) fid.seek(etp) # skip data to go to event table - etmode = fid.read(1).decode() + etmode = fid.read(1) if etmode != "": - etmode = np.fromstring(etmode, UINT8).tolist()[0] + etmode = np.frombuffer(etmode, dtype=UINT8).tolist()[0] if edf_info["number"] < 1.94: sr = np.fromfile(fid, UINT8, 3)