本文整理汇总了Python中matplotlib.mlab.detrend_linear方法的典型用法代码示例。如果您正苦于以下问题:Python mlab.detrend_linear方法的具体用法?Python mlab.detrend_linear怎么用?Python mlab.detrend_linear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类matplotlib.mlab
的用法示例。
在下文中一共展示了mlab.detrend_linear方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_detrend_linear_0D_zeros
# 需要导入模块: from matplotlib import mlab [as 别名]
# 或者: from matplotlib.mlab import detrend_linear [as 别名]
def test_detrend_linear_0D_zeros(self):
input = 0.
targ = 0.
res = mlab.detrend_linear(input)
assert_almost_equal(res, targ)
示例2: test_detrend_linear_0D_off
# 需要导入模块: from matplotlib import mlab [as 别名]
# 或者: from matplotlib.mlab import detrend_linear [as 别名]
def test_detrend_linear_0D_off(self):
input = 5.5
targ = 0.
res = mlab.detrend_linear(input)
assert_almost_equal(res, targ)
示例3: test_detrend_detrend_linear_0D_off
# 需要导入模块: from matplotlib import mlab [as 别名]
# 或者: from matplotlib.mlab import detrend_linear [as 别名]
def test_detrend_detrend_linear_0D_off(self):
input = 5.5
targ = 0.
res = mlab.detrend(input, key=mlab.detrend_linear)
assert_almost_equal(res, targ)
示例4: test_detrend_linear_1d_off
# 需要导入模块: from matplotlib import mlab [as 别名]
# 或者: from matplotlib.mlab import detrend_linear [as 别名]
def test_detrend_linear_1d_off(self):
input = self.sig_off
targ = self.sig_zeros
res = mlab.detrend_linear(input)
assert_allclose(res, targ, atol=self.atol)
示例5: test_detrend_linear_1d_slope
# 需要导入模块: from matplotlib import mlab [as 别名]
# 或者: from matplotlib.mlab import detrend_linear [as 别名]
def test_detrend_linear_1d_slope(self):
input = self.sig_slope
targ = self.sig_zeros
res = mlab.detrend_linear(input)
assert_allclose(res, targ, atol=self.atol)
示例6: test_detrend_detrend_linear_1d_slope_off
# 需要导入模块: from matplotlib import mlab [as 别名]
# 或者: from matplotlib.mlab import detrend_linear [as 别名]
def test_detrend_detrend_linear_1d_slope_off(self):
input = self.sig_slope + self.sig_off
targ = self.sig_zeros
res = mlab.detrend(input, key=mlab.detrend_linear)
assert_allclose(res, targ, atol=self.atol)
示例7: test_detrend_linear_1d_slope_off_list
# 需要导入模块: from matplotlib import mlab [as 别名]
# 或者: from matplotlib.mlab import detrend_linear [as 别名]
def test_detrend_linear_1d_slope_off_list(self):
input = self.sig_slope + self.sig_off
targ = self.sig_zeros
res = mlab.detrend_linear(input.tolist())
assert_allclose(res, targ, atol=self.atol)
示例8: test_detrend_linear_2D_ValueError
# 需要导入模块: from matplotlib import mlab [as 别名]
# 或者: from matplotlib.mlab import detrend_linear [as 别名]
def test_detrend_linear_2D_ValueError(self):
input = self.sig_slope[np.newaxis]
assert_raises(ValueError, mlab.detrend_linear, input)
示例9: test_detrend_detrend_linear_1d_slope_off_axis1
# 需要导入模块: from matplotlib import mlab [as 别名]
# 或者: from matplotlib.mlab import detrend_linear [as 别名]
def test_detrend_detrend_linear_1d_slope_off_axis1(self):
arri = [self.sig_off,
self.sig_slope,
self.sig_slope + self.sig_off]
arrt = [self.sig_zeros,
self.sig_zeros,
self.sig_zeros]
input = np.vstack(arri).T
targ = np.vstack(arrt).T
res = mlab.detrend(input, key=mlab.detrend_linear, axis=0)
assert_allclose(res, targ, atol=self.atol)
示例10: test_detrend_linear_2D_ValueError
# 需要导入模块: from matplotlib import mlab [as 别名]
# 或者: from matplotlib.mlab import detrend_linear [as 别名]
def test_detrend_linear_2D_ValueError(self):
input = self.sig_slope[np.newaxis]
with pytest.raises(ValueError):
mlab.detrend_linear(input)
示例11: test_detrend_detrend_linear_1d_slope_off_axis1_notranspose
# 需要导入模块: from matplotlib import mlab [as 别名]
# 或者: from matplotlib.mlab import detrend_linear [as 别名]
def test_detrend_detrend_linear_1d_slope_off_axis1_notranspose(self):
arri = [self.sig_off,
self.sig_slope,
self.sig_slope + self.sig_off]
arrt = [self.sig_zeros,
self.sig_zeros,
self.sig_zeros]
input = np.vstack(arri)
targ = np.vstack(arrt)
res = mlab.detrend(input, key=mlab.detrend_linear, axis=1)
assert_allclose(res, targ, atol=self.atol)