0
Ich habe ein einfaches Programm, das ich unten eingefügt habe. Ich habe ein Problem, weil, wenn ich das Programm ausführen, bekomme ich einen Fehler. Hier sind meine Fehler:"Axis größer als Daten Dimensionen" - Python
Traceback (most recent call last):
File "C:\Users\Anaconda3\lib\site-packages\pywt\_multilevel.py", line 90, in wavedec
axes_shape = data.shape[axis]
IndexError: tuple index out of range
During handling of the above exception, another exception occurred:
python
Traceback (most recent call last):
File "C:/Users/Main.py", line 10, in <module>
tree = pywt.wavedec(data=record, wavelet='db2', level=5, mode='symmetric')
File "C:\Users\Anaconda3\lib\site-packages\pywt\_multilevel.py", line 92, in wavedec
raise ValueError("Axis greater than data dimensions")
ValueError: Axis greater than data dimensions
Und dies ist mein Code:
import wfdb
import pywt
import matplotlib.pyplot as plt
record = wfdb.rdsamp('230', sampto = 2000)
annotation = wfdb.rdann('230', 'atr', sampto = 2000)
wfdb.plotrec(record, annotation = annotation, title='Output record', timeunits = 'seconds')
tree = pywt.wavedec(data=record, wavelet='db2', level=5, mode='symmetric')
newTree = [tree[0], tree[1], tree[2], tree[3]*0, tree[4]*0, tree[5]*0]
recSignal = pywt.waverec(newTree, 'db2')
plt.plot(recSignal[:2000])
Was, Ihrer Meinung nach, könnte in dem Code ändern, um die Programmarbeit zu machen?
Der Fehler ist in der pywt Modul zur Linie, Linie 90, so sollten Sie uns diesen Code zeigen. –
Außerdem rufen Sie mit dem Aufruf von numpy.darray.shape das 'axis' Element von' shape' ab, und der Fehler besagt, dass größer als die Dimensionen von 'dat.shape' ist –