如何解决此错误axiserror:轴1超出了维1的数组的范围
问题描述:
Traceback (most recent call last):
File "<pyshell#18>", line 1, in <module>
result = waipy.cwt(data_norm, 1, 1, 0.25, 2, 4/0.25, alpha, 6, mother='Morlet')
File "/usr/local/lib/python2.7/dist-packages/waipy/cwt/wavetest.py", line 75, in cwt
ondaleta,wave,period,scale,coi,f = lib_wavelet.wavelet(data,dt,mother,param)#,pad,dj,s0,j1,mother,param)
File "/usr/local/lib/python2.7/dist-packages/waipy/cwt/lib_wavelet.py", line 132, in wavelet
k = np.concatenate((k_pos,k_neg), axis =1) # vector of symmetric
AxisError: axis 1 is out of bounds for array of dimension 1
我尝试过:
What I have tried:
result = cwt(data_norm, 1, 1, 0.25, 2, 4/0.25, alpha, 6, mother='Morlet')
答
您的数组中只有1个项目,如错误消息中所述。数组元素从零开始寻址。
You only have 1 item in your array, as noted in the error message. Array elements are addressed starting at zero.