python类rate()的实例源码

test_financial.py 文件源码 项目:radar 作者: amoose136 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def test_rate(self):
        assert_almost_equal(np.rate(10, 0, -3500, 10000),
                            0.1107, 4)
test_financial.py 文件源码 项目:radar 作者: amoose136 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def test_pmt(self):
        res = np.pmt(0.08/12, 5*12, 15000)
        tgt = -304.145914
        assert_allclose(res, tgt)
        # Test the edge case where rate == 0.0
        res = np.pmt(0.0, 5*12, 15000)
        tgt = -250.0
        assert_allclose(res, tgt)
        # Test the case where we use broadcast and
        # the arguments passed in are arrays.
        res = np.pmt([[0.0, 0.8],[0.3, 0.8]],[12, 3],[2000, 20000])
        tgt = np.array([[-166.66667, -19311.258],[-626.90814, -19311.258]])
        assert_allclose(res, tgt)
test_financial.py 文件源码 项目:krpcScripts 作者: jwvanderbeck 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def test_rate(self):
        assert_almost_equal(np.rate(10, 0, -3500, 10000),
                            0.1107, 4)
test_financial.py 文件源码 项目:krpcScripts 作者: jwvanderbeck 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def test_pmt(self):
        res = np.pmt(0.08/12, 5*12, 15000)
        tgt = -304.145914
        assert_allclose(res, tgt)
        # Test the edge case where rate == 0.0
        res = np.pmt(0.0, 5*12, 15000)
        tgt = -250.0
        assert_allclose(res, tgt)
        # Test the case where we use broadcast and
        # the arguments passed in are arrays.
        res = np.pmt([[0.0, 0.8],[0.3, 0.8]],[12, 3],[2000, 20000])
        tgt = np.array([[-166.66667, -19311.258],[-626.90814, -19311.258]])
        assert_allclose(res, tgt)
test_financial.py 文件源码 项目:aws-lambda-numpy 作者: vitolimandibhrata 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def test_rate(self):
        assert_almost_equal(np.rate(10, 0, -3500, 10000),
                            0.1107, 4)
test_financial.py 文件源码 项目:aws-lambda-numpy 作者: vitolimandibhrata 项目源码 文件源码 阅读 37 收藏 0 点赞 0 评论 0
def test_pmt(self):
        res = np.pmt(0.08/12, 5*12, 15000)
        tgt = -304.145914
        assert_allclose(res, tgt)
        # Test the edge case where rate == 0.0
        res = np.pmt(0.0, 5*12, 15000)
        tgt = -250.0
        assert_allclose(res, tgt)
        # Test the case where we use broadcast and
        # the arguments passed in are arrays.
        res = np.pmt([[0.0, 0.8],[0.3, 0.8]],[12, 3],[2000, 20000])
        tgt = np.array([[-166.66667, -19311.258],[-626.90814, -19311.258]])
        assert_allclose(res, tgt)
test_financial.py 文件源码 项目:lambda-numba 作者: rlhotovy 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def test_rate(self):
        assert_almost_equal(np.rate(10, 0, -3500, 10000),
                            0.1107, 4)
test_financial.py 文件源码 项目:lambda-numba 作者: rlhotovy 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def test_pmt(self):
        res = np.pmt(0.08/12, 5*12, 15000)
        tgt = -304.145914
        assert_allclose(res, tgt)
        # Test the edge case where rate == 0.0
        res = np.pmt(0.0, 5*12, 15000)
        tgt = -250.0
        assert_allclose(res, tgt)
        # Test the case where we use broadcast and
        # the arguments passed in are arrays.
        res = np.pmt([[0.0, 0.8],[0.3, 0.8]],[12, 3],[2000, 20000])
        tgt = np.array([[-166.66667, -19311.258],[-626.90814, -19311.258]])
        assert_allclose(res, tgt)
test_financial.py 文件源码 项目:deliver 作者: orchestor 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def test_rate(self):
        assert_almost_equal(np.rate(10, 0, -3500, 10000),
                            0.1107, 4)
test_financial.py 文件源码 项目:deliver 作者: orchestor 项目源码 文件源码 阅读 42 收藏 0 点赞 0 评论 0
def test_pmt(self):
        res = np.pmt(0.08/12, 5*12, 15000)
        tgt = -304.145914
        assert_allclose(res, tgt)
        # Test the edge case where rate == 0.0
        res = np.pmt(0.0, 5*12, 15000)
        tgt = -250.0
        assert_allclose(res, tgt)
        # Test the case where we use broadcast and
        # the arguments passed in are arrays.
        res = np.pmt([[0.0, 0.8],[0.3, 0.8]],[12, 3],[2000, 20000])
        tgt = np.array([[-166.66667, -19311.258],[-626.90814, -19311.258]])
        assert_allclose(res, tgt)
test_financial.py 文件源码 项目:Alfred 作者: jkachhadia 项目源码 文件源码 阅读 42 收藏 0 点赞 0 评论 0
def test_rate(self):
        assert_almost_equal(np.rate(10, 0, -3500, 10000),
                            0.1107, 4)
test_financial.py 文件源码 项目:Alfred 作者: jkachhadia 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def test_pmt(self):
        res = np.pmt(0.08/12, 5*12, 15000)
        tgt = -304.145914
        assert_allclose(res, tgt)
        # Test the edge case where rate == 0.0
        res = np.pmt(0.0, 5*12, 15000)
        tgt = -250.0
        assert_allclose(res, tgt)
        # Test the case where we use broadcast and
        # the arguments passed in are arrays.
        res = np.pmt([[0.0, 0.8],[0.3, 0.8]],[12, 3],[2000, 20000])
        tgt = np.array([[-166.66667, -19311.258],[-626.90814, -19311.258]])
        assert_allclose(res, tgt)


问题


面经


文章

微信
公众号

扫码关注公众号