连续小波变换如何选择尺度

How to chose scale for continuous wavelet transformation

我正在尝试使用连续小波变换,但我不断收到 ValueError: Only dim == 1 supported. 我的数据是 pandas 数据帧。

我试过使用以下方法:

df2 = py.cwt(df, scales=1, wavelet='gaus1')

我的结果是

ValueError: only dim == 1
Traceback (most recent call last):

  File "<ipython-input-1-4c0398b4c4f3>", line 1, in <module>
    runfile('/home/user_1/untitled6.py', wdir='/home/user_1')

  File "/usr/lib/python3/dist-packages/spyder/utils/site/sitecustomize.py", line 705, in runfile
    execfile(filename, namespace)

  File "/usr/lib/python3/dist-packages/spyder/utils/site/sitecustomize.py", line 102, in execfile
    exec(compile(f.read(), filename, 'exec'), namespace)

  File "/home/user_1/untitled6.py", line 41, in <module>
    df2 = py.cwt(df,scales ,wavelet='gaus1')

  File "/home/user_1/.local/lib/python3.6/site-packages/pywt/_cwt.py", line 107, in cwt
    raise ValueError("Only dim == 1 supported")

pywt.cwt() 提供一维 连续小波变换。使用 Pandas 时,您可以将其应用于系列,但不能应用于数据框。