ZeroDivisionError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_28896/14777483.py in <module>
1 # Apply the detection using yasa.spindles_detect
----> 2 sp = yasa.spindles_detect(data, sf)
3
4 # Display the results using .summary()
5 sp.summary()
S:\Anaconda\envs\yasa_env\lib\site-packages\yasa\detection.py in spindles_detect(data, sf, ch_names, hypno, include, freq_sp, freq_broad, duration, min_distance, thresh, multi_only, remove_outliers, verbose)
675 _, mcorr = moving_transform(x=data_sigma[i, :], y=data_broad[i, :],
676 sf=sf, window=.3, step=.1,
--> 677 method='corr', interp=True)
678 if do_rms:
679 _, mrms = moving_transform(x=data_sigma[i, :], sf=sf,
S:\Anaconda\envs\yasa_env\lib\site-packages\yasa\others.py in moving_transform(x, y, sf, window, step, method, interp)
192 if method in ['covar', 'corr']:
193 for i in range(idx.size):
--> 194 out[i] = func(x[beg[i]:end[i]], y[beg[i]:end[i]])
195 else:
196 for i in range(idx.size):
S:\Anaconda\envs\yasa_env\lib\site-packages\yasa\others.py in func(x, y)
183 elif method == 'corr':
184 def func(x, y):
--> 185 return _corr(x, y)
186
187 else:
ZeroDivisionError: division by zero
I want to know why would I encounter this problem, hope your help.
I download code and run 01_spindles_detection.ipynb , then I got an error:
Then I change
sp = yasa.spindles_detect(data, sf)tosp = yasa.spindles_detect(data, sf, thresh={'rel_pow': 0.2, 'corr': None, 'rms': 1.5})and the code can sucessfully run.I want to know why would I encounter this problem, hope your help.