當前位置: 首頁>>代碼示例>>Python>>正文


Python mlab.demean方法代碼示例

本文整理匯總了Python中matplotlib.mlab.demean方法的典型用法代碼示例。如果您正苦於以下問題:Python mlab.demean方法的具體用法?Python mlab.demean怎麽用?Python mlab.demean使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在matplotlib.mlab的用法示例。


在下文中一共展示了mlab.demean方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_demean_0D_off

# 需要導入模塊: from matplotlib import mlab [as 別名]
# 或者: from matplotlib.mlab import demean [as 別名]
def test_demean_0D_off(self):
        input = 5.5
        targ = 0.
        res = mlab.demean(input, axis=None)
        assert_almost_equal(res, targ) 
開發者ID:miloharper,項目名稱:neural-network-animation,代碼行數:7,代碼來源:test_mlab.py

示例2: test_demean_1D_base_slope_off

# 需要導入模塊: from matplotlib import mlab [as 別名]
# 或者: from matplotlib.mlab import demean [as 別名]
def test_demean_1D_base_slope_off(self):
        input = self.sig_base + self.sig_slope + self.sig_off
        targ = self.sig_base + self.sig_slope_mean
        res = mlab.demean(input)
        assert_allclose(res, targ, atol=1e-08) 
開發者ID:miloharper,項目名稱:neural-network-animation,代碼行數:7,代碼來源:test_mlab.py

示例3: test_demean_1D_base_slope_off_axis0

# 需要導入模塊: from matplotlib import mlab [as 別名]
# 或者: from matplotlib.mlab import demean [as 別名]
def test_demean_1D_base_slope_off_axis0(self):
        input = self.sig_base + self.sig_slope + self.sig_off
        targ = self.sig_base + self.sig_slope_mean
        res = mlab.demean(input, axis=0)
        assert_allclose(res, targ, atol=1e-08) 
開發者ID:miloharper,項目名稱:neural-network-animation,代碼行數:7,代碼來源:test_mlab.py

示例4: test_demean_1D_base_slope_off_list

# 需要導入模塊: from matplotlib import mlab [as 別名]
# 或者: from matplotlib.mlab import demean [as 別名]
def test_demean_1D_base_slope_off_list(self):
        input = self.sig_base + self.sig_slope + self.sig_off
        targ = self.sig_base + self.sig_slope_mean
        res = mlab.demean(input.tolist())
        assert_allclose(res, targ, atol=1e-08) 
開發者ID:miloharper,項目名稱:neural-network-animation,代碼行數:7,代碼來源:test_mlab.py

示例5: test_demean_2D_default

# 需要導入模塊: from matplotlib import mlab [as 別名]
# 或者: from matplotlib.mlab import demean [as 別名]
def test_demean_2D_default(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.demean(input)
        assert_allclose(res, targ,
                        atol=1e-08) 
開發者ID:miloharper,項目名稱:neural-network-animation,代碼行數:16,代碼來源:test_mlab.py

示例6: test_demean_2D_axis0

# 需要導入模塊: from matplotlib import mlab [as 別名]
# 或者: from matplotlib.mlab import demean [as 別名]
def test_demean_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.demean(input, axis=0)
        assert_allclose(res, targ,
                        atol=1e-08) 
開發者ID:miloharper,項目名稱:neural-network-animation,代碼行數:16,代碼來源:test_mlab.py

示例7: test_demean_2D_axis1

# 需要導入模塊: from matplotlib import mlab [as 別名]
# 或者: from matplotlib.mlab import demean [as 別名]
def test_demean_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.demean(input, axis=1)
        assert_allclose(res, targ,
                        atol=1e-08) 
開發者ID:miloharper,項目名稱:neural-network-animation,代碼行數:16,代碼來源:test_mlab.py

示例8: test_demean_2D_axism1

# 需要導入模塊: from matplotlib import mlab [as 別名]
# 或者: from matplotlib.mlab import demean [as 別名]
def test_demean_2D_axism1(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.demean(input, axis=-1)
        assert_allclose(res, targ,
                        atol=1e-08) 
開發者ID:miloharper,項目名稱:neural-network-animation,代碼行數:16,代碼來源:test_mlab.py

示例9: test_demean_1D_d1_ValueError

# 需要導入模塊: from matplotlib import mlab [as 別名]
# 或者: from matplotlib.mlab import demean [as 別名]
def test_demean_1D_d1_ValueError(self):
        input = self.sig_slope
        assert_raises(ValueError, mlab.demean, input, axis=1) 
開發者ID:miloharper,項目名稱:neural-network-animation,代碼行數:5,代碼來源:test_mlab.py

示例10: test_demean_2D_d2_ValueError

# 需要導入模塊: from matplotlib import mlab [as 別名]
# 或者: from matplotlib.mlab import demean [as 別名]
def test_demean_2D_d2_ValueError(self):
        input = self.sig_slope[np.newaxis]
        assert_raises(ValueError, mlab.demean, input, axis=2) 
開發者ID:miloharper,項目名稱:neural-network-animation,代碼行數:5,代碼來源:test_mlab.py

示例11: test_demean_1D_d1_ValueError

# 需要導入模塊: from matplotlib import mlab [as 別名]
# 或者: from matplotlib.mlab import demean [as 別名]
def test_demean_1D_d1_ValueError(self):
        input = self.sig_slope
        with pytest.raises(ValueError):
            mlab.demean(input, axis=1) 
開發者ID:holzschu,項目名稱:python3_ios,代碼行數:6,代碼來源:test_mlab.py

示例12: test_demean_2D_d2_ValueError

# 需要導入模塊: from matplotlib import mlab [as 別名]
# 或者: from matplotlib.mlab import demean [as 別名]
def test_demean_2D_d2_ValueError(self):
        input = self.sig_slope[np.newaxis]
        with pytest.raises(ValueError):
            mlab.demean(input, axis=2) 
開發者ID:holzschu,項目名稱:python3_ios,代碼行數:6,代碼來源:test_mlab.py


注:本文中的matplotlib.mlab.demean方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。