我有一个要通过中值过滤器处理的数据。
我在专用软件中工作,因此某些行专门为此编写 这是我的代码的样子:
from scipy.signal import medfilt
### I load the variables here
rhob_original=RHOB.values()
rhob_smoothed = medfilt(RHOB.values(),WINDOW_SIZE)
phi_original=RHOB.values()
phi_smoothed = medfilt(PHI.values(), WINDOW_SIZE)
### Replace some spurious numbers at the endpoints because of the NaN values
for i in range(len(rhob_smoothed)):
if rhob_smoothed[i]<0:
rhob_smoothed[i]=rhob_original[i]
elif rhob_smoothed[i]>10:
rhob_smoothed[i]=rhob_original[i]
elif rhob_smoothed[i]==-9999:
rhob_smoothed[i]=-9999
for i in range(len(phi_smoothed)):
if phi_smoothed[i]<0:
phi_smoothed[i]=phi_original[i]
elif phi_smoothed[i]>10:
phi_smoothed[i]=phi_original[i]
elif phi_smoothed[i]==-9999:
phi_smoothed[i]=-9999
### Saving them to the software adapted varibales
LOOP:
rhob_smooth=rhob_smoothed[loopIterator]
phi_smooth=phi_smoothed[loopIterator]
问题从我导入软件包的第一行开始说:
Traceback (most recent call last):
File "<string>", line 1 (103), in <module>
File "C:\Program Files\---company name---\---software name---\Python36_x64\lib\site-packages\scipy\signal\__init__.py", line 297, in <module>
from ._max_len_seq import max_len_seq
File "C:\Program Files\---company name---\---software name---\Python36_x64\lib\site-packages\scipy\signal\_max_len_seq.py", line 8, in <module>
from ._max_len_seq_inner import _max_len_seq_inner
File "stringsource", line 103, in init scipy.signal._max_len_seq_inner
AttributeError: type object 'scipy.signal._max_len_seq_inner.array' has no attribute '__reduce_cython__'
我不太明白这里出了什么问题。