I’m running the example sensor_connectivity.ipynb (“Compute all-to-all connectivity in sensor space”) in version 1.4 (Centos 7). When I change method='pli'
to method='coh'
in spectral_connectivity_epochs(), I get the following error message (from plot_connectivity_epochs()) which I don’t understand.
ValueError Traceback (most recent call last)
Cell In[34], line 34
29 con = spectral_connectivity_epochs(
30 epochs, method=‘coh’, mode=‘multitaper’, sfreq=sfreq, fmin=fmin, fmax=fmax,
31 faverage=True, tmin=tmin, mt_adaptive=False, n_jobs=1)
33 # Now, visualize the connectivity in 3D:
—> 34 plot_sensors_connectivity(
35 epochs.info,
36 con.get_data(output=‘dense’)[:, :, 0])
File /imaging/local/software/mne_python/mne1.4.0_1/lib/python3.10/site-packages/mne_connectivity/viz/_3d.py:84, in plot_sensors_connectivity(info, con, picks, cbar_label)
81 con_val = np.array(con_val)
83 # Show the connections as tubes between sensors
—> 84 vmax = np.max(con_val)
85 vmin = np.min(con_val)
86 for val, nodes in zip(con_val, con_nodes):
File <array_function internals>:5, in amax(*args, **kwargs)
File /imaging/local/software/mne_python/mne1.4.0_1/lib/python3.10/site-packages/numpy/core/fromnumeric.py:2754, in amax(a, axis, out, keepdims, initial, where)
2638 @array_function_dispatch(_amax_dispatcher)
2639 def amax(a, axis=None, out=None, keepdims=np._NoValue, initial=np._NoValue,
2640 where=np._NoValue):
2641 “”"
2642 Return the maximum of an array or maximum along an axis.
2643
(…)
2752 5
2753 “”"
→ 2754 return _wrapreduction(a, np.maximum, ‘max’, axis, None, out,
2755 keepdims=keepdims, initial=initial, where=where)
File /imaging/local/software/mne_python/mne1.4.0_1/lib/python3.10/site-packages/numpy/core/fromnumeric.py:86, in _wrapreduction(obj, ufunc, method, axis, dtype, out, **kwargs)
83 else:
84 return reduction(axis=axis, out=out, **passkwargs)
—> 86 return ufunc.reduce(obj, axis, dtype, out, **passkwargs)
ValueError: zero-size array to reduction operation maximum which has no identity