本文整理匯總了Python中matplotlib.mlab.detrend方法的典型用法代碼示例。如果您正苦於以下問題:Python mlab.detrend方法的具體用法?Python mlab.detrend怎麽用?Python mlab.detrend使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類matplotlib.mlab
的用法示例。
在下文中一共展示了mlab.detrend方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_detrend_str_none_0D_zeros
# 需要導入模塊: from matplotlib import mlab [as 別名]
# 或者: from matplotlib.mlab import detrend [as 別名]
def test_detrend_str_none_0D_zeros(self):
input = 0.
targ = input
res = mlab.detrend(input, key='none')
assert_equal(input, targ)
示例2: test_detrend_detrend_none_0D_zeros
# 需要導入模塊: from matplotlib import mlab [as 別名]
# 或者: from matplotlib.mlab import detrend [as 別名]
def test_detrend_detrend_none_0D_zeros(self):
input = 0.
targ = input
res = mlab.detrend(input, key=mlab.detrend_none)
assert_equal(input, targ)
示例3: test_detrend_str_mean_0D_zeros
# 需要導入模塊: from matplotlib import mlab [as 別名]
# 或者: from matplotlib.mlab import detrend [as 別名]
def test_detrend_str_mean_0D_zeros(self):
input = 0.
targ = 0.
res = mlab.detrend(input, key='mean')
assert_almost_equal(res, targ)
示例4: test_detrend_detrend_mean_0D_zeros
# 需要導入模塊: from matplotlib import mlab [as 別名]
# 或者: from matplotlib.mlab import detrend [as 別名]
def test_detrend_detrend_mean_0D_zeros(self):
input = 0.
targ = 0.
res = mlab.detrend(input, key=mlab.detrend_mean)
assert_almost_equal(res, targ)
示例5: test_detrend_str_mean_0D_off
# 需要導入模塊: from matplotlib import mlab [as 別名]
# 或者: from matplotlib.mlab import detrend [as 別名]
def test_detrend_str_mean_0D_off(self):
input = 5.5
targ = 0.
res = mlab.detrend(input, key='mean')
assert_almost_equal(res, targ)
示例6: test_detrend_2D_default
# 需要導入模塊: from matplotlib import mlab [as 別名]
# 或者: from matplotlib.mlab import detrend [as 別名]
def test_detrend_2D_default(self):
arri = [self.sig_off,
self.sig_base + self.sig_off]
arrt = [self.sig_zeros,
self.sig_base]
input = np.vstack(arri)
targ = np.vstack(arrt)
res = mlab.detrend(input)
assert_allclose(res, targ, atol=1e-08)
示例7: test_detrend_2D_none
# 需要導入模塊: from matplotlib import mlab [as 別名]
# 或者: from matplotlib.mlab import detrend [as 別名]
def test_detrend_2D_none(self):
arri = [self.sig_off,
self.sig_base + self.sig_off]
arrt = [self.sig_zeros,
self.sig_base]
input = np.vstack(arri)
targ = np.vstack(arrt)
res = mlab.detrend(input, axis=None)
assert_allclose(res, targ, atol=1e-08)
示例8: test_detrend_str_mean_2D_axis0
# 需要導入模塊: from matplotlib import mlab [as 別名]
# 或者: from matplotlib.mlab import detrend [as 別名]
def test_detrend_str_mean_2D_axis0(self):
arri = [self.sig_base,
self.sig_base + self.sig_off,
self.sig_base + self.sig_slope,
self.sig_base + self.sig_off + self.sig_slope]
arrt = [self.sig_base,
self.sig_base,
self.sig_base + self.sig_slope_mean,
self.sig_base + self.sig_slope_mean]
input = np.vstack(arri).T
targ = np.vstack(arrt).T
res = mlab.detrend(input, key='mean', axis=0)
assert_allclose(res, targ,
atol=1e-08)
示例9: test_detrend_str_constant_2D_none_T
# 需要導入模塊: from matplotlib import mlab [as 別名]
# 或者: from matplotlib.mlab import detrend [as 別名]
def test_detrend_str_constant_2D_none_T(self):
arri = [self.sig_off,
self.sig_base + self.sig_off]
arrt = [self.sig_zeros,
self.sig_base]
input = np.vstack(arri).T
targ = np.vstack(arrt)
res = mlab.detrend(input, key='constant', axis=None)
assert_allclose(res.T, targ,
atol=1e-08)
示例10: test_detrend_str_default_2D_axis1
# 需要導入模塊: from matplotlib import mlab [as 別名]
# 或者: from matplotlib.mlab import detrend [as 別名]
def test_detrend_str_default_2D_axis1(self):
arri = [self.sig_base,
self.sig_base + self.sig_off,
self.sig_base + self.sig_slope,
self.sig_base + self.sig_off + self.sig_slope]
arrt = [self.sig_base,
self.sig_base,
self.sig_base + self.sig_slope_mean,
self.sig_base + self.sig_slope_mean]
input = np.vstack(arri)
targ = np.vstack(arrt)
res = mlab.detrend(input, key='default', axis=1)
assert_allclose(res, targ,
atol=1e-08)
示例11: test_detrend_bad_key_str_ValueError
# 需要導入模塊: from matplotlib import mlab [as 別名]
# 或者: from matplotlib.mlab import detrend [as 別名]
def test_detrend_bad_key_str_ValueError(self):
input = self.sig_slope[np.newaxis]
assert_raises(ValueError, mlab.detrend, input, key='spam')
示例12: test_detrend_bad_key_var_ValueError
# 需要導入模塊: from matplotlib import mlab [as 別名]
# 或者: from matplotlib.mlab import detrend [as 別名]
def test_detrend_bad_key_var_ValueError(self):
input = self.sig_slope[np.newaxis]
assert_raises(ValueError, mlab.detrend, input, key=5)
示例13: test_detrend_0D_d0_ValueError
# 需要導入模塊: from matplotlib import mlab [as 別名]
# 或者: from matplotlib.mlab import detrend [as 別名]
def test_detrend_0D_d0_ValueError(self):
input = 5.5
assert_raises(ValueError, mlab.detrend, input, axis=0)
示例14: test_detrend_1D_d1_ValueError
# 需要導入模塊: from matplotlib import mlab [as 別名]
# 或者: from matplotlib.mlab import detrend [as 別名]
def test_detrend_1D_d1_ValueError(self):
input = self.sig_slope
assert_raises(ValueError, mlab.detrend, input, axis=1)
示例15: test_detrend_2D_d2_ValueError
# 需要導入模塊: from matplotlib import mlab [as 別名]
# 或者: from matplotlib.mlab import detrend [as 別名]
def test_detrend_2D_d2_ValueError(self):
input = self.sig_slope[np.newaxis]
assert_raises(ValueError, mlab.detrend, input, axis=2)