fooof-tools / fooof

Parameterizing neural power spectra into periodic & aperiodic components.
https://fooof-tools.github.io/
Apache License 2.0
363 stars 98 forks source link

FOOOFGroup method : ValueError: setting an array element with a sequence. #333

Closed Clemencegdx closed 2 months ago

Clemencegdx commented 2 months ago

Hi, I’m trying to apply a FOOOFGroup method on a matrix of 20 PSD with 201 point of frequencies. My datas are a PSD array (20,201) and frequencies array (201,).

When i’m runing the ‘fg.group_results’ i’v this kind of message - that i also have when i run in details the ‘get_params’ function ‘peak_params’. That’s not occurs with the ‘aperiodic_params’ and ‘exponent’.

FOOOF fg.get_params(‘peak_params’) File ~/Applications/MNE-Python/1.5.1_0/.mne-python/lib/python3.11/site-packages/fooof/objs/group.py:379 in get_params out = np.array([np.insert(getattr(data, name), 3, index, axis=1) ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (20,) + inhomogeneous part.

Do you have idea of what i'm doing wrong to get this kind of error?

Thanks you very much

Clémence

TomDonoghue commented 2 months ago

Hey @Clemencegdx - I think this is the same issue as in #313. Long story short, if you check your fooof version and update to 1.1, this should be updated and fixed (perhaps also check and update your version of numpy).

Clemencegdx commented 2 months ago

Hi Tom, Oh yes!! the problem was the numpy version... i was in 1.24...

Thanks you very much :)

Clémence