我正在尝试使用 Python 执行小波。
代码
import numpy
from matplotlib import pyplot
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
import pycwt as wavelet
dat = pd.read_csv("....Monthly.csv")
title = 'Sea Ice Extent'
label = 'Ross Sea'
units = 'sq km'
t0 = 1979.0
dt = 0.25 # In years
#creating time in arrays
N = dat.size #length of the time domain
t = numpy.arange(0, N) * dt + t0
#de-trending and normalsie
p = numpy.polyfit(t - t0, dat, 1)
dat_notrend = dat - numpy.polyval(p, t - t0)
std = dat_notrend.std() # Standard deviation
var = std ** 2 # Variance
dat_norm = dat_notrend / std # Normalized dataset
错误信息
***ValueError*** in p = numpy.polyfit(t - t0, dat, 1) <__array_function__ internals> in polyfit(*args, **kwargs)
.