You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am getting an error while running the following code
x = np.random.randn(256)
w = pywt.wavedec(x, wavelet='haar', level=3)
w_arr, w_cs = pywt.coeffs_to_array(w)
w2 = pywt.array_to_coeffs(w_arr, w_cs)
x_recon = pywt.waverec(w2, wavelet='haar')
The error message is
~/anaconda3/lib/python3.6/site-packages/pywt/_multilevel.py in waverec(coeffs, wavelet, mode, axis)
145 if (a is not None) and (d is not None):
146 try:
--> 147 if a.shape[axis] == d.shape[axis] + 1:
148 a = a[[slice(s) for s in d.shape]]
149 elif a.shape[axis] != d.shape[axis]:
AttributeError: 'dict' object has no attribute 'shape'
The code runs if I change waverec to waverecn however.
I can try to look at this soon but I'm new to pywavelet so I don't know how long it will take me !
Syl
The text was updated successfully, but these errors were encountered:
The reason for this is that it is not possible to tell from the concatenated array which transform generated the data. Perhaps it would have been better to make output_format a required argument (although at this point I would vote to leave it as is for backward compatibility)?
This is not a bug, but it is perhaps worth adding a check in wavedec itself to return a more informative error message if the coefficients received are not of the proper format. As is, the attribute error that occurred in your case is not helpful in diagnosing the problem.
Hello,
I am getting an error while running the following code
The error message is
The code runs if I change waverec to waverecn however.
I can try to look at this soon but I'm new to pywavelet so I don't know how long it will take me !
Syl
The text was updated successfully, but these errors were encountered: