• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python numpy.ipmt函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中numpy.ipmt函数的典型用法代码示例。如果您正苦于以下问题:Python ipmt函数的具体用法?Python ipmt怎么用?Python ipmt使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了ipmt函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: test_broadcast_decimal

    def test_broadcast_decimal(self):
        # Use almost equal because precision is tested in the explicit tests, this test is to ensure
        # broadcast with Decimal is not broken.
        assert_almost_equal(np.ipmt(Decimal('0.1') / Decimal('12'), list(range(5)), Decimal('24'), Decimal('2000')),
                            [Decimal('-17.29165168'), Decimal('-16.66666667'), Decimal('-16.03647345'),
                             Decimal('-15.40102862'), Decimal('-14.76028842')], 4)

        assert_almost_equal(np.ppmt(Decimal('0.1') / Decimal('12'), list(range(5)), Decimal('24'), Decimal('2000')),
                            [Decimal('-74.998201'), Decimal('-75.62318601'), Decimal('-76.25337923'),
                             Decimal('-76.88882405'), Decimal('-77.52956425')], 4)

        assert_almost_equal(np.ppmt(Decimal('0.1') / Decimal('12'), list(range(5)), Decimal('24'), Decimal('2000'),
                                    Decimal('0'), [Decimal('0'), Decimal('0'), Decimal('1'), 'end', 'begin']),
                            [Decimal('-74.998201'), Decimal('-75.62318601'), Decimal('-75.62318601'),
                             Decimal('-76.88882405'), Decimal('-76.88882405')], 4)
开发者ID:Horta,项目名称:numpy,代码行数:15,代码来源:test_financial.py


示例2: test_broadcast

    def test_broadcast(self):
        assert_almost_equal(np.nper(0.075,-2000,0,100000.,[0,1]),
                            [ 21.5449442 ,  20.76156441], 4)

        assert_almost_equal(np.ipmt(0.1/12,list(range(5)), 24, 2000),
                            [-17.29165168, -16.66666667, -16.03647345,
                                -15.40102862, -14.76028842], 4)

        assert_almost_equal(np.ppmt(0.1/12,list(range(5)), 24, 2000),
                            [-74.998201  , -75.62318601, -76.25337923,
                                -76.88882405, -77.52956425], 4)

        assert_almost_equal(np.ppmt(0.1/12,list(range(5)), 24, 2000, 0,
            [0,0,1,'end','begin']),
                            [-74.998201  , -75.62318601, -75.62318601,
                                -76.88882405, -76.88882405], 4)
开发者ID:BlackEarth,项目名称:portable-python-win32,代码行数:16,代码来源:test_financial.py


示例3: eq_subvention

def eq_subvention(montant, duree, taux):
    """ Calcule l' "équivalent subvention" par rapport à un taux 0%
    pour chacune des différentes combinaisons d'hypothèses possibles"""
    # RAZ des résultats
    equivalent_subvention = np.zeros((len(montant), len(duree), len(taux)))
    part_subventionee = np.zeros((len(montant), len(duree), len(taux)))
    # Calcule de l' "équivalent subvention"
    for i in range(len(montant)):
        for j in range(len(duree)):
            # Périodicité des remboursements
            per = np.arange(duree[j]) + 1
            for k in range(len(taux)):
                # Calcule l'échancier des intérêts perçus
                echeancier_interets = -np.ipmt(taux[k], per, duree[j], montant[i])
                # Calcule et enregistre l' "équivalent subvention" comparé
                # à un taux 0 pour le jeu d'hypothèses considéré, les flux
                # d'intérêt étant actualisés à 4%
                equivalent_subvention[i, j, k] = np.npv(0.04, echeancier_interets)
                # ou alternativemen, sans actualiser:
                # equivalent_subvention[i,j,k]=np.sum(echeancier_interets)
                part_subventionee[i, j, k] = (equivalent_subvention[i, j, k] / montant[i]) * 100
    return equivalent_subvention, part_subventionee
开发者ID:milinc,项目名称:ptre,代码行数:22,代码来源:abaque.py


示例4: test_when

    def test_when(self):
        # begin
        assert_almost_equal(np.rate(10, 20, -3500, 10000, 1), np.rate(10, 20, -3500, 10000, "begin"), 4)
        # end
        assert_almost_equal(np.rate(10, 20, -3500, 10000), np.rate(10, 20, -3500, 10000, "end"), 4)
        assert_almost_equal(np.rate(10, 20, -3500, 10000, 0), np.rate(10, 20, -3500, 10000, "end"), 4)

        # begin
        assert_almost_equal(np.pv(0.07, 20, 12000, 0, 1), np.pv(0.07, 20, 12000, 0, "begin"), 2)
        # end
        assert_almost_equal(np.pv(0.07, 20, 12000, 0), np.pv(0.07, 20, 12000, 0, "end"), 2)
        assert_almost_equal(np.pv(0.07, 20, 12000, 0, 0), np.pv(0.07, 20, 12000, 0, "end"), 2)

        # begin
        assert_almost_equal(np.fv(0.075, 20, -2000, 0, 1), np.fv(0.075, 20, -2000, 0, "begin"), 4)
        # end
        assert_almost_equal(np.fv(0.075, 20, -2000, 0), np.fv(0.075, 20, -2000, 0, "end"), 4)
        assert_almost_equal(np.fv(0.075, 20, -2000, 0, 0), np.fv(0.075, 20, -2000, 0, "end"), 4)

        # begin
        assert_almost_equal(np.pmt(0.08 / 12, 5 * 12, 15000.0, 0, 1), np.pmt(0.08 / 12, 5 * 12, 15000.0, 0, "begin"), 4)
        # end
        assert_almost_equal(np.pmt(0.08 / 12, 5 * 12, 15000.0, 0), np.pmt(0.08 / 12, 5 * 12, 15000.0, 0, "end"), 4)
        assert_almost_equal(np.pmt(0.08 / 12, 5 * 12, 15000.0, 0, 0), np.pmt(0.08 / 12, 5 * 12, 15000.0, 0, "end"), 4)

        # begin
        assert_almost_equal(np.ppmt(0.1 / 12, 1, 60, 55000, 0, 1), np.ppmt(0.1 / 12, 1, 60, 55000, 0, "begin"), 4)
        # end
        assert_almost_equal(np.ppmt(0.1 / 12, 1, 60, 55000, 0), np.ppmt(0.1 / 12, 1, 60, 55000, 0, "end"), 4)
        assert_almost_equal(np.ppmt(0.1 / 12, 1, 60, 55000, 0, 0), np.ppmt(0.1 / 12, 1, 60, 55000, 0, "end"), 4)

        # begin
        assert_almost_equal(np.ipmt(0.1 / 12, 1, 24, 2000, 0, 1), np.ipmt(0.1 / 12, 1, 24, 2000, 0, "begin"), 4)
        # end
        assert_almost_equal(np.ipmt(0.1 / 12, 1, 24, 2000, 0), np.ipmt(0.1 / 12, 1, 24, 2000, 0, "end"), 4)
        assert_almost_equal(np.ipmt(0.1 / 12, 1, 24, 2000, 0, 0), np.ipmt(0.1 / 12, 1, 24, 2000, 0, "end"), 4)

        # begin
        assert_almost_equal(np.nper(0.075, -2000, 0, 100000.0, 1), np.nper(0.075, -2000, 0, 100000.0, "begin"), 4)
        # end
        assert_almost_equal(np.nper(0.075, -2000, 0, 100000.0), np.nper(0.075, -2000, 0, 100000.0, "end"), 4)
        assert_almost_equal(np.nper(0.075, -2000, 0, 100000.0, 0), np.nper(0.075, -2000, 0, 100000.0, "end"), 4)
开发者ID:Xatpy,项目名称:echomesh,代码行数:42,代码来源:test_financial.py


示例5: test_ipmt

 def test_ipmt(self):
     np.round(np.ipmt(0.1/12,1,24,2000),2) == 16.67
开发者ID:BlackEarth,项目名称:portable-python-win32,代码行数:2,代码来源:test_financial.py


示例6: test_decimal_with_when

    def test_decimal_with_when(self):
        """Test that decimals are still supported if the when argument is passed"""
        # begin
        assert_equal(np.rate(Decimal('10'), Decimal('20'), Decimal('-3500'), Decimal('10000'), Decimal('1')),
                     np.rate(Decimal('10'), Decimal('20'), Decimal('-3500'), Decimal('10000'), 'begin'))
        # end
        assert_equal(np.rate(Decimal('10'), Decimal('20'), Decimal('-3500'), Decimal('10000')),
                     np.rate(Decimal('10'), Decimal('20'), Decimal('-3500'), Decimal('10000'), 'end'))
        assert_equal(np.rate(Decimal('10'), Decimal('20'), Decimal('-3500'), Decimal('10000'), Decimal('0')),
                     np.rate(Decimal('10'), Decimal('20'), Decimal('-3500'), Decimal('10000'), 'end'))

        # begin
        assert_equal(np.pv(Decimal('0.07'), Decimal('20'), Decimal('12000'), Decimal('0'), Decimal('1')),
                     np.pv(Decimal('0.07'), Decimal('20'), Decimal('12000'), Decimal('0'), 'begin'))
        # end
        assert_equal(np.pv(Decimal('0.07'), Decimal('20'), Decimal('12000'), Decimal('0')),
                     np.pv(Decimal('0.07'), Decimal('20'), Decimal('12000'), Decimal('0'), 'end'))
        assert_equal(np.pv(Decimal('0.07'), Decimal('20'), Decimal('12000'), Decimal('0'), Decimal('0')),
                     np.pv(Decimal('0.07'), Decimal('20'), Decimal('12000'), Decimal('0'), 'end'))

        # begin
        assert_equal(np.fv(Decimal('0.075'), Decimal('20'), Decimal('-2000'), Decimal('0'), Decimal('1')),
                     np.fv(Decimal('0.075'), Decimal('20'), Decimal('-2000'), Decimal('0'), 'begin'))
        # end
        assert_equal(np.fv(Decimal('0.075'), Decimal('20'), Decimal('-2000'), Decimal('0')),
                     np.fv(Decimal('0.075'), Decimal('20'), Decimal('-2000'), Decimal('0'), 'end'))
        assert_equal(np.fv(Decimal('0.075'), Decimal('20'), Decimal('-2000'), Decimal('0'), Decimal('0')),
                     np.fv(Decimal('0.075'), Decimal('20'), Decimal('-2000'), Decimal('0'), 'end'))

        # begin
        assert_equal(np.pmt(Decimal('0.08') / Decimal('12'), Decimal('5') * Decimal('12'), Decimal('15000.'),
                            Decimal('0'), Decimal('1')),
                     np.pmt(Decimal('0.08') / Decimal('12'), Decimal('5') * Decimal('12'), Decimal('15000.'),
                            Decimal('0'), 'begin'))
        # end
        assert_equal(np.pmt(Decimal('0.08') / Decimal('12'), Decimal('5') * Decimal('12'), Decimal('15000.'),
                            Decimal('0')),
                     np.pmt(Decimal('0.08') / Decimal('12'), Decimal('5') * Decimal('12'), Decimal('15000.'),
                            Decimal('0'), 'end'))
        assert_equal(np.pmt(Decimal('0.08') / Decimal('12'), Decimal('5') * Decimal('12'), Decimal('15000.'),
                            Decimal('0'), Decimal('0')),
                     np.pmt(Decimal('0.08') / Decimal('12'), Decimal('5') * Decimal('12'), Decimal('15000.'),
                            Decimal('0'), 'end'))

        # begin
        assert_equal(np.ppmt(Decimal('0.1') / Decimal('12'), Decimal('1'), Decimal('60'), Decimal('55000'),
                             Decimal('0'), Decimal('1')),
                     np.ppmt(Decimal('0.1') / Decimal('12'), Decimal('1'), Decimal('60'), Decimal('55000'),
                             Decimal('0'), 'begin'))
        # end
        assert_equal(np.ppmt(Decimal('0.1') / Decimal('12'), Decimal('1'), Decimal('60'), Decimal('55000'),
                             Decimal('0')),
                     np.ppmt(Decimal('0.1') / Decimal('12'), Decimal('1'), Decimal('60'), Decimal('55000'),
                             Decimal('0'), 'end'))
        assert_equal(np.ppmt(Decimal('0.1') / Decimal('12'), Decimal('1'), Decimal('60'), Decimal('55000'),
                             Decimal('0'), Decimal('0')),
                     np.ppmt(Decimal('0.1') / Decimal('12'), Decimal('1'), Decimal('60'), Decimal('55000'),
                             Decimal('0'), 'end'))

        # begin
        assert_equal(np.ipmt(Decimal('0.1') / Decimal('12'), Decimal('1'), Decimal('24'), Decimal('2000'),
                             Decimal('0'), Decimal('1')).flat[0],
                     np.ipmt(Decimal('0.1') / Decimal('12'), Decimal('1'), Decimal('24'), Decimal('2000'),
                             Decimal('0'), 'begin').flat[0])
        # end
        assert_equal(np.ipmt(Decimal('0.1') / Decimal('12'), Decimal('1'), Decimal('24'), Decimal('2000'),
                             Decimal('0')).flat[0],
                     np.ipmt(Decimal('0.1') / Decimal('12'), Decimal('1'), Decimal('24'), Decimal('2000'),
                             Decimal('0'), 'end').flat[0])
        assert_equal(np.ipmt(Decimal('0.1') / Decimal('12'), Decimal('1'), Decimal('24'), Decimal('2000'),
                             Decimal('0'), Decimal('0')).flat[0],
                     np.ipmt(Decimal('0.1') / Decimal('12'), Decimal('1'), Decimal('24'), Decimal('2000'),
                             Decimal('0'), 'end').flat[0])
开发者ID:Horta,项目名称:numpy,代码行数:73,代码来源:test_financial.py


示例7: test_when

    def test_when(self):
        # begin
        assert_equal(np.rate(10, 20, -3500, 10000, 1),
                     np.rate(10, 20, -3500, 10000, 'begin'))
        # end
        assert_equal(np.rate(10, 20, -3500, 10000),
                     np.rate(10, 20, -3500, 10000, 'end'))
        assert_equal(np.rate(10, 20, -3500, 10000, 0),
                     np.rate(10, 20, -3500, 10000, 'end'))

        # begin
        assert_equal(np.pv(0.07, 20, 12000, 0, 1),
                     np.pv(0.07, 20, 12000, 0, 'begin'))
        # end
        assert_equal(np.pv(0.07, 20, 12000, 0),
                     np.pv(0.07, 20, 12000, 0, 'end'))
        assert_equal(np.pv(0.07, 20, 12000, 0, 0),
                     np.pv(0.07, 20, 12000, 0, 'end'))

        # begin
        assert_equal(np.fv(0.075, 20, -2000, 0, 1),
                     np.fv(0.075, 20, -2000, 0, 'begin'))
        # end
        assert_equal(np.fv(0.075, 20, -2000, 0),
                     np.fv(0.075, 20, -2000, 0, 'end'))
        assert_equal(np.fv(0.075, 20, -2000, 0, 0),
                     np.fv(0.075, 20, -2000, 0, 'end'))

        # begin
        assert_equal(np.pmt(0.08 / 12, 5 * 12, 15000., 0, 1),
                     np.pmt(0.08 / 12, 5 * 12, 15000., 0, 'begin'))
        # end
        assert_equal(np.pmt(0.08 / 12, 5 * 12, 15000., 0),
                     np.pmt(0.08 / 12, 5 * 12, 15000., 0, 'end'))
        assert_equal(np.pmt(0.08 / 12, 5 * 12, 15000., 0, 0),
                     np.pmt(0.08 / 12, 5 * 12, 15000., 0, 'end'))

        # begin
        assert_equal(np.ppmt(0.1 / 12, 1, 60, 55000, 0, 1),
                     np.ppmt(0.1 / 12, 1, 60, 55000, 0, 'begin'))
        # end
        assert_equal(np.ppmt(0.1 / 12, 1, 60, 55000, 0),
                     np.ppmt(0.1 / 12, 1, 60, 55000, 0, 'end'))
        assert_equal(np.ppmt(0.1 / 12, 1, 60, 55000, 0, 0),
                     np.ppmt(0.1 / 12, 1, 60, 55000, 0, 'end'))

        # begin
        assert_equal(np.ipmt(0.1 / 12, 1, 24, 2000, 0, 1),
                     np.ipmt(0.1 / 12, 1, 24, 2000, 0, 'begin'))
        # end
        assert_equal(np.ipmt(0.1 / 12, 1, 24, 2000, 0),
                     np.ipmt(0.1 / 12, 1, 24, 2000, 0, 'end'))
        assert_equal(np.ipmt(0.1 / 12, 1, 24, 2000, 0, 0),
                     np.ipmt(0.1 / 12, 1, 24, 2000, 0, 'end'))

        # begin
        assert_equal(np.nper(0.075, -2000, 0, 100000., 1),
                     np.nper(0.075, -2000, 0, 100000., 'begin'))
        # end
        assert_equal(np.nper(0.075, -2000, 0, 100000.),
                     np.nper(0.075, -2000, 0, 100000., 'end'))
        assert_equal(np.nper(0.075, -2000, 0, 100000., 0),
                     np.nper(0.075, -2000, 0, 100000., 'end'))
开发者ID:Horta,项目名称:numpy,代码行数:63,代码来源:test_financial.py


示例8: test_ipmt_decimal

 def test_ipmt_decimal(self):
     result = np.ipmt(Decimal('0.1') / Decimal('12'), 1, 24, 2000)
     assert_equal(result.flat[0], Decimal('-16.66666666666666666666666667'))
开发者ID:Horta,项目名称:numpy,代码行数:3,代码来源:test_financial.py


示例9: test_ipmt

 def test_ipmt(self):
     assert_almost_equal(np.round(np.ipmt(0.1 / 12, 1, 24, 2000), 2), -16.67)
开发者ID:Horta,项目名称:numpy,代码行数:2,代码来源:test_financial.py


示例10: abs

        # Master Output [Direct Loan]
        outData["levelCostDirect"] = Rate_Levelized_Direct
        outData["costPanelDirect"] = abs(NPVLoanDirect / numberPanels)
        outData["cost10WPanelDirect"] = (
            float(outData["costPanelDirect"]) / panelSize) * 10

        # NCREBs Financing
        ncrebsRate = float(inputDict.get("NCREBRate", 4.060)) / 100
        ncrebBorrowingRate = 1.1 * ncrebsRate
        ncrebPaymentPeriods = 44
        ncrebCostToCustomer = []
        # TODO ASAP: FIX ARRAY OFFSETS START 0
        for i in range(1, len(outData["allYearGenerationMWh"]) + 1):
            coopLoanPayment = 2 * pmt(ncrebBorrowingRate / 2.0, ncrebPaymentPeriods, outData[
                                      "totalCost"]) if i <= ncrebPaymentPeriods / 2 else 0
            ncrebsCredit = -0.7 * (ipmt(ncrebsRate / 2, 2 * i - 1, ncrebPaymentPeriods, outData["totalCost"])
                                   + ipmt(ncrebsRate / 2, 2 * i, ncrebPaymentPeriods, outData["totalCost"])) if i <= ncrebPaymentPeriods / 2 else 0
            financingCost = ncrebsCredit + coopLoanPayment
            omCost = OMInsuranceETCDirect[i - 1]
            netCoopPayments = financingCost + omCost
            distrAdder = distAdderDirect[i - 1]
            costToCustomer = netCoopPayments + distrAdder
            ncrebCostToCustomer.append(costToCustomer)
        NPVLoanNCREB = npv(
            float(inputDict.get("discRate", 0)) / 100, [0, 0] + ncrebCostToCustomer)
        Rate_Levelized_NCREB = -NPVLoanNCREB / NPVallYearGenerationMWh
        outData["levelCostNCREB"] = Rate_Levelized_NCREB
        outData["costPanelNCREB"] = abs(NPVLoanNCREB / numberPanels)
        outData["cost10WPanelNCREB"] = (
            float(outData["costPanelNCREB"]) / panelSize) * 10
开发者ID:geomf,项目名称:omf-fork,代码行数:30,代码来源:solarSunda.py


示例11: work


#.........这里部分代码省略.........
	payment = pmt(float(inputDict.get("loanRate",0))/100, loanYears, outData["totalCost"])
	interestDirectPI = outData["totalCost"] * float(inputDict.get("loanRate",0))/100
	principleDirectPI = (-payment - interestDirectPI)
	patronageCapitalRetiredDPI = 0
	netFinancingCostsDirect = -(principleDirectPI + interestDirectPI - patronageCapitalRetiredDPI)
	#Output - Direct Loan [E] [F] [G] [H]
	firstYearOPMainCosts = (1.25 * arraySizeDC * 12)
	firstYearInsuranceCosts = (0.37 * outData["totalCost"]/100)
	if (inputDict.get("landOwnership",0) == "Leased"):
		firstYearLandLeaseCosts = float(inputDict.get("costAcre",0))*landAmount
	else:
		firstYearLandLeaseCosts = 0
	for i in range (1, len(outData["allYearGenerationMWh"])+1):
		OMInsuranceETCDirect.append(-firstYearOPMainCosts*math.pow((1 + .01),(i-1)) - firstYearInsuranceCosts*math.pow((1 + .025),(i-1)) - firstYearLandLeaseCosts*math.pow((1 + .01),(i-1)))
		distAdderDirect.append(float(inputDict.get("distAdder",0))*outData["allYearGenerationMWh"][i])
		netCoopPaymentsDirect.append(OMInsuranceETCDirect[i-1] + netFinancingCostsDirect)
		costToCustomerDirect.append((netCoopPaymentsDirect[i-1] - distAdderDirect[i-1]))
	#Output - Direct Loan [F53] 
	NPVLoanDirect = npv(float(inputDict.get("discRate",0))/100, [0,0] + costToCustomerDirect)
	NPVallYearGenerationMWh = npv(float(inputDict.get("discRate",0))/100, [0,0] + outData["allYearGenerationMWh"].values())
	Rate_Levelized_Direct = -NPVLoanDirect/NPVallYearGenerationMWh	
	#Master Output [Direct Loan]
	outData["levelCostDirect"] = Rate_Levelized_Direct
	outData["costPanelDirect"] = abs(NPVLoanDirect/numberPanels)
	outData["cost10WPanelDirect"] = (float(outData["costPanelDirect"])/panelSize)*10
	### NCREBs Financing
	ncrebsRate = float(inputDict.get("NCREBRate",4.060))/100
	ncrebBorrowingRate = 1.1 * ncrebsRate
	ncrebPaymentPeriods = 44
	ncrebCostToCustomer = []
	# TODO ASAP: FIX ARRAY OFFSETS START 0
	for i in range (1, len(outData["allYearGenerationMWh"])+1):
		coopLoanPayment = 2 * pmt(ncrebBorrowingRate/2.0, ncrebPaymentPeriods, outData["totalCost"]) if i <= ncrebPaymentPeriods / 2 else 0
		ncrebsCredit = -0.7 * (ipmt(ncrebsRate / 2, 2 * i - 1, ncrebPaymentPeriods, outData["totalCost"])
			+ ipmt(ncrebsRate / 2, 2 * i, ncrebPaymentPeriods, outData["totalCost"])) if i <= ncrebPaymentPeriods / 2 else 0
		financingCost = ncrebsCredit + coopLoanPayment
		omCost = OMInsuranceETCDirect[i - 1]
		netCoopPayments = financingCost + omCost
		distrAdder = distAdderDirect[i - 1]
		costToCustomer = netCoopPayments + distrAdder
		ncrebCostToCustomer.append(costToCustomer)
	NPVLoanNCREB = npv(float(inputDict.get("discRate", 0))/100, [0,0] + ncrebCostToCustomer)
	Rate_Levelized_NCREB = -NPVLoanNCREB/NPVallYearGenerationMWh	
	outData["levelCostNCREB"] = Rate_Levelized_NCREB
	outData["costPanelNCREB"] = abs(NPVLoanNCREB/numberPanels)
	outData["cost10WPanelNCREB"] = (float(outData["costPanelNCREB"])/panelSize)*10
	### Lease Buyback Structure
	#Output - Lease [C]
	projectCostsLease = outData["totalCost"]
	#Output - Lease [D]
	leasePaymentsLease = []
	#Output - Lease [E]
	OMInsuranceETCLease = OMInsuranceETCDirect
	#Output - Lease [F]
	distAdderLease = distAdderDirect
	#Output - Lease [G]
	netCoopPaymentsLease = []
	#Output - Lease [H]
	costToCustomerLease = []
	#Output - Lease [H44]
	NPVLease = 0
	#Output - Lease [H49]
	Rate_Levelized_Lease = 0
	## Tax Lease Formulas
	#Output - Lease [D]
	for i in range (0, 12):
开发者ID:dpinney,项目名称:omf,代码行数:67,代码来源:solarSunda.py


示例12: loans

df = df.rename(columns=rename_dict)
df = df.rename(columns=purpose_dict)

# identify good loans and bad loans (might include the 31 to 120 day late category later)
df.loc[df['ls_default'] == 1, 'bad_loan'] = 1
df.loc[df['ls_chargeoff'] == 1, 'bad_loan'] = 1
df.loc[df['bad_loan'] != 1, 'bad_loan'] = 0
df.loc[df['bad_loan'] != 1, 'good_loan'] = 1
df.loc[df['good_loan'] != 1, 'good_loan'] = 0

# add columns related to debt service and debt service coverage

# calculate annual debt service payments for Lending Club loans
df['annual_prin'] = sum([np.ppmt(df['int_rate'] / 12, i, df['term'], -df['loan_amnt'], 0) for i in range(1, 13)])
df['annual_prin'] = df['annual_prin'].round(2)
df['annual_int'] = sum([np.ipmt(df['int_rate'] / 12, i, df['term'], -df['loan_amnt'], 0) for i in range(1, 13)])
df['annual_int'] = df['annual_int'].round(2)
df['annual_debt_svc'] = df['annual_prin'] + df['annual_int']
df['annual_debt_svc'] = df['annual_debt_svc'].round(2)

# total revolving debt NOT attributable to Lending Club loans
df['other_rev_debt'] = df['total_bal_ex_mort'] - df['out_prncp']
df.loc[df['other_rev_debt'] < 0, 'other_rev_debt'] = 0

# total mortgage/installment debt (also not Lending Club)
df['other_mort_debt'] = df['tot_cur_bal'] - df['other_rev_debt']
df.loc[df['other_mort_debt'] < 0, 'other_mort_debt'] = 0

# estimated annual debt service requirement on non-Lending-Club revolving debt (at Lending Club int_rate, 5yr amort)
df['addl_annual_rev_ds'] = (12 * (df['other_rev_debt'] / 60)) + (df['int_rate'] * df['other_rev_debt'])
df['addl_annual_rev_ds'] = df['addl_annual_rev_ds'].round(2)
开发者ID:mgd34msu,项目名称:detanokagaku,代码行数:31,代码来源:credit.py



注:本文中的numpy.ipmt函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python numpy.isclose函数代码示例发布时间:2022-05-27
下一篇:
Python numpy.invert函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap