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

Python numpy.pv函数代码示例

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

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



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

示例1: calcPrice

 def calcPrice(self):
     if self.par != None and self.cr != None and self.cy != None:
         self.pr = (self.par*self.cr)/self.cy
     elif self.par != None and self.cr != None and self.ytm != None:
         self.pr = -1*np.pv(0.5*self.ytm, 2.0*self.mat, 0.5*self.par*self.cr, self.par)
         
     print "Bond price = $%.2f" % self.pr
开发者ID:bradfordlynch,项目名称:rossMiscCodes,代码行数:7,代码来源:FIN503_Tools.py


示例2: calculate_bond_price

    def calculate_bond_price(self):
        present_value = np.pv(
            rate=self.annual_required_return / self.annual_payment_frequency,
            nper=self.term_to_maturity * self.annual_payment_frequency,
            pmt=self.semi_annual_coupon_payment,
            fv=self.face_value
        )

        return -0.1 * present_value
开发者ID:bsmukasa,项目名称:bond_analytics,代码行数:9,代码来源:models.py


示例3: _calc

 def _calc(self):
     # shortcut if the portfolio is 0...some of the math
     # below doesn't like 0s.
     if self.portfolio.value == 0:
         return Decimal(0)
     amount = pmt(self.rate, self.final_age - self.current_age, self.portfolio.value)
     desired_pmt = self.desired_payment * self.cumulative_inflation
     desired_value = pv(float(self.rate), self.final_age - self.current_age, float(-desired_pmt), when='begin')
     desired_value = Decimal(desired_value)
     tilt = (self.portfolio.value / desired_value) ** self.tilt
     return amount * tilt
开发者ID:hoostus,项目名称:prime-harvesting,代码行数:11,代码来源:inverted.py


示例4: getFitForN

def getFitForN(N):
    a = []
    for i in range(1, N + 1):
        row = []
        for j in range(N - 1, -1, -1):
            row.append(pow(i, j))
        a.append(row)
    a = na(a)
    b = na([sequence(i) for i in range(1, N + 1)])
    coeffs = solve(a, b)
    fit = pv(coeffs, N + 1)
    return fit
开发者ID:shomchak,项目名称:ProjectEuler,代码行数:12,代码来源:e101.py


示例5: levelize_costs

 def levelize_costs(self):
     if hasattr(self, 'is_levelized'):
         inflation = float(cfg.cfgfile.get('case', 'inflation_rate'))
         rate = self.cost_of_capital - inflation
         if self.is_levelized == 0:
             self.values_level = - np.pmt(rate, self.book_life, 1, 0, 'end') * self.values
             util.convert_age(self, vintages=self.vintages, years=self.years, attr_from='values_level', attr_to='values_level', reverse=False)
         else:
             self.values_level = self.values.copy()
             util.convert_age(self, vintages=self.vintages, years=self.years, attr_from='values_level', attr_to='values_level', reverse=False)
             self.values = np.pv(rate, self.book_life, -1, 0, 'end') * self.values
     else:
         raise ValueError('Supply Technology id %s needs to indicate whether costs are levelized ' %self.id)
开发者ID:anamileva,项目名称:energyPATHWAYS,代码行数:13,代码来源:supply_technologies.py


示例6: levelize_costs

 def levelize_costs(self):
     if hasattr(self, 'is_levelized'):
         inflation = float(cfg.cfgfile.get('case', 'inflation_rate'))
         rate = self.cost_of_capital - inflation
         if self.is_levelized == 0:
             self.values_level = - np.pmt(rate, self.book_life, 1, 0, 'end') * self.values
             util.convert_age(self, vintages=self.vintages, years=self.years, attr_from='values_level', attr_to='values_level', reverse=False)
         else:
             self.values_level = self.values.copy()
             util.convert_age(self, vintages=self.vintages, years=self.years, attr_from='values_level', attr_to='values_level', reverse=False)
             self.values = np.pv(rate, self.book_life, -1, 0, 'end') * self.values
     else:
         util.convert_age(self, vintages=self.vintages, years=self.years, reverse=False)
开发者ID:tuberculo,项目名称:energyPATHWAYS,代码行数:13,代码来源:supply_technologies.py


示例7: calc_compounding

def calc_compounding ( _rate, _periods, _principal, _contribution, _delta, _inflation ) :
	in_rate = 0.01 * _rate
	in_delta   = 0.01 * _delta
	in_contrib = -1* _contribution
	in_princ   = -1* _principal
	in_inflation = 0.01* inflation
	print("rate %g, periods %g, principal %g, contribution %g, delta %g, inflation %g" %( _rate, _periods, in_princ, in_contrib, _delta, _inflation))
	cf1 = np.array([round(np.fv(in_rate, i, in_contrib, in_princ, when='end'),2) for i in range(1,periods+1)])
	cf2 = np.array([round(np.fv((in_rate-in_delta), i, in_contrib, in_princ, when='end'),2) for i in range(1,periods+1)])
	if _inflation == 0:
		return(np.subtract(cf1,cf2))
	else:
		diff = np.subtract(cf1,cf2)
		return np.array([round(np.pv(in_inflation, i, 0, (-1*diff[i])),2)  for i in range(_periods)])
开发者ID:bansalr,项目名称:fund_allocation,代码行数:14,代码来源:rate_of_return.py


示例8: harvest

    def harvest(self):
        amount = yield
        while True:
            # In order to get rid of the memory effect, the parameters to PV
            # have to independent of *when* you retire. But they can use current information

            # This is just our life expectancy.
            nper = max(5, 100 - self.current_age)
            #nper = mortality.life_expectancy(self.current_age, None)

            # But let's also subtract out however many years worth of bonds
            # we currently have. This assumes that bonds keep up with inflation
            # which is a dubious proposition...
            #nper -= int(self.portfolio.bonds / amount)

            # Set a minimum years worth of stock. Pretty arbitrarily chosen...
            portfolio_goal = Decimal(-numpy.pv(float(self.rate), nper, float(amount), when='beginning'))

            if self.portfolio.stocks >= portfolio_goal:
                #import pdb;pdb.set_trace()
                #harvest_amount = self.portfolio.stocks - portfolio_goal
                harvest_amount = self.portfolio.stocks / 4
                self.portfolio.sell_stocks(harvest_amount)
                self.portfolio.buy_bonds(harvest_amount)
                #print(self.current_age, " ", harvest_amount.to_integral_value(), " ", self.portfolio.stocks.to_integral_value(), "{%d}" % amount)
            else:
                #print(self.current_age, "[", portfolio_goal.to_integral_value(), "]", self.portfolio.stocks.to_integral_value(), "{%d}" % amount)
                pass

            amount = min(amount, self.portfolio.value)

            amount_bonds = min(amount, self.portfolio.bonds)
            amount_stocks = amount - amount_bonds
            self.portfolio.sell_bonds(amount_bonds)
            self.portfolio.sell_stocks(amount_stocks)
            
            amount = yield self.portfolio.empty_cash()

            self.current_age += 1
开发者ID:hoostus,项目名称:prime-harvesting,代码行数:39,代码来源:actuarial.py


示例9: 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


示例10: do_proforma


#.........这里部分代码省略.........
                            out=component_sales_revenue)
                else:
                    sales_revenue = 0
                if sales_revenue < 0: sales_revenue = 0
                
                # before reaching full occupancy for rent property
                if not sold_for_rent and any(component_rent_revenue <= c['rent_revenue']):
                    rent_revenue = np.min(column_stack((c['rent_revenue'],
                                                        component_rent_revenue)),
                                          axis=1
                                          )
                    operating_cost = (rent_revenue * c['operating_cost']).sum()
                    vacancy = (rent_revenue * c['vacancy_rates']).sum()
                    rent_revenue = rent_revenue.sum()                    
                    component_rent_revenue += c['rent_revenue_per_period']
                    np.clip(component_rent_revenue, 
                            0, c['rent_revenue'],
                            out=component_rent_revenue)
                    
                if not sold_for_rent and any(component_leases_revenue <= c['leases_revenue']):
                    leases_revenue = np.min(column_stack((c['leases_revenue'],
                                                          component_leases_revenue)),
                                            axis=1
                                            )
                    operating_cost += (leases_revenue * c['operating_cost']).sum()
                    vacancy += (leases_revenue * c['vacancy_rates']).sum()
                    leases_revenue = leases_revenue.sum()
                    component_leases_revenue += c['leases_revenue_per_period']
                    np.clip(component_leases_revenue, 
                            0, c['leases_revenue'],
                            out=component_leases_revenue)                    
 
                #revenues
                if not sold_for_rent:
                    revenues[period] += sales_revenue + rent_revenue + leases_revenue
                else:
                    revenues[period] = sales_revenue
                    if revenues[period] == 0:
                        break                

                #costs
                taxable_proportion = p['rent_sqft'] / p['total_sqft'].astype(float32)
                tax = p['property_tax'] * (p['land_cost'] + p['construction_cost']) * taxable_proportion
                insurance = p['rent_sqft'] * property_insurance
                construction_equity = 0
                construction_loan_interest_payment = construction_loan_balance * construction_loan_rate
                construction_loan_repayment = revenues[period] \
                        if construction_loan_balance > revenues[period] \
                        else construction_loan_balance
                
                #adjustment to revenues/costs
                for_rent_noi = rent_revenue + leases_revenue - tax - insurance - operating_cost - vacancy
                meets_perm_load_occupancy_threshold = rent_revenue + leases_revenue > \
                                                               ( p['rent_revenue'] + p['leases_revenue']) * \
                                                               perm_load_occupancy_threshold
                
                if perm_loan_size == 0 and \
                   for_rent_noi > 0 and \
                   meets_perm_load_occupancy_threshold:
                    perm_loan_size = min((for_rent_noi / cap_rate) * ltv_max,
                                          -np.pv(perm_loan_rate, 
                                                perm_loan_term, 
                                                for_rent_noi / dcr_max)
                                       )
                    perm_loan_proceeds = perm_loan_size
                    revenues[period] += perm_loan_proceeds

                if perm_loan_size > 0:
                    perm_loan_interest_payment = -np.pmt(perm_loan_rate, perm_loan_term, perm_loan_size)
                
                if not sold_for_rent:
                    costs[period] += tax + insurance + operating_cost + vacancy + \
                            construction_loan_interest_payment + construction_loan_repayment + \
                            perm_loan_interest_payment
                else:
                    costs[period] = 0
                
                construction_loan_balance -= construction_loan_repayment
                if DEBUG: print period, sales_revenue, full_rent_periods, for_rent_seasoning_threshold 
                if full_rent_periods > for_rent_seasoning_threshold+1 and \
                   sales_revenue <= 0 and \
                   not sold_for_rent:
                    #sell_for_rent = 1
                    perm_loan_repayment = perm_loan_size
                    for_rent_sale = for_rent_noi / cap_rate
                    revenues[period] += for_rent_sale
                    costs[period] += perm_loan_repayment
                    sold_for_rent = 1
                    #break

        if DEBUG: print "REVENUES:", revenues
        costs = costs * (1.0-p['costdiscount'])
        if DEBUG: print "COSTS:", costs
        cash_flow = (revenues - costs)[1:period]
        npv = np.npv(discount_rate, cash_flow)
        if DEBUG: print "CASHFLOW:", cash_flow
        if DEBUG: print "NPV:", npv
        irr = np.irr(cash_flow)

        return asarray(npv)
开发者ID:psrc,项目名称:urbansim,代码行数:101,代码来源:proforma.py


示例11: calculate_previous_balance

 def calculate_previous_balance(loan):
     return np.pv((loan.rate/100)/loan.period, loan.period, -loan.payment, -loan.present_balance)
开发者ID:jimboston,项目名称:LoanCalculator,代码行数:2,代码来源:loancalculator.py


示例12: get_required_portfolio

 def get_required_portfolio(self):
     amount = self.current_rate * self.portfolio.value
     pv = numpy.pv(float(self.get_rate()), self.get_life_expectancy(), float(-amount), when='beginning')
     return Decimal(pv)
开发者ID:hoostus,项目名称:prime-harvesting,代码行数:4,代码来源:stout.py


示例13:

# 时间点的价值。
# pv函数计算现值(present value),即金融资产当前的价值。
# npv函数返回的是净现值(net present value),即按折现率计算的净现金流之和。
# pmt函数根据本金和利率计算每期需支付的金额。
# irr函数计算内部收益率(internal rate of return)。内部收益率是是净现值为0时的有效利
# 率,不考虑通胀因素。
# mirr函数计算修正后内部收益率(modified internal rate of return),是内部收益率的改进
# 版本。
# nper函数计算定期付款的期数。
# rate函数计算利率(rate of interest)。
print u"终值"
#fv函数参数为利率,参数,每期支付金额,现值
print "Future value",np.fv(0.03/4, 5*4,-10,1000)
print u"现值"
#pv函数参数为利率,参数,每期支付金额,终值
print "Present value",np.pv(0.03/4,5*4,-10,1376.09633204)
#npv参数为利率和一个表示现金流的数组.
cashflows = np.random.randint(100,size=5)
cashflows = np.insert(cashflows,0,-100)
print "Cashflows",cashflows
print "Net present value",np.npv(0.03,cashflows)
print u"内部收益率"
print "Internal rate of return",np.irr([-100, 38, 48,90 ,17,36])

print u"分期付款"
#pmt输入为利率和期数,总价,输出每期钱数
print "Payment",np.pmt(0.10/12,12*30,100000)
#nper参数为贷款利率,固定的月供和贷款额,输出付款期数
print "Number of payments", np.nper(0.10/12,-100,9000)
#rate参数为付款期数,每期付款资金,现值和终值计算利率
print "Interest rate",12*np.rate(167,-100,9000,0)
开发者ID:moonlmq,项目名称:Tools,代码行数:31,代码来源:Learn_TypicalFunction.py


示例14: print

Näide 2
Kui suur peab olema investeeringu hetkeväärtus, et 10 aasta päras oleks
kogunenud 14485.09€, kui aastane intressimäär on 3.5% ning me lisame
investeeringule iga kuu 100€? Kui suur peab olema alginvesteering, et selline
summa koguneks 5, 6, 7, 8 või 9 aastaga?
------------------------------------------------------------------------------
"""

print("\nNäide 2\n-------\n")

RATE = 0.035 / 12  # 3.5% aastas, 3.5%/12 perioodis
PERIOD = 10*12  # 10 aastat
PAYMENT = -100  # maksame 100€ kuus, '-' tähendab raha väljavoolu
FV = 14485.09  # soovitud tulemus

PRESENT_VALUE = np.pv(RATE, PERIOD, PAYMENT, FV, when='end')
print("Et toota {0}€, peaks investeeringu hetkeväärtus olema {1:.2f}€."
      .format(FV, -PRESENT_VALUE)  # '-' tähistab väljaminekut
      )

PERIODS = np.array([5, 6, 7, 8, 9])
PRESENT_VALUES = np.pv(RATE, PERIODS*12, PAYMENT, FV, when='end')
for period, pv in zip(PERIODS, PRESENT_VALUES):
    print("{0} aasta korral peaks investeeringu hetkeväärtus olema {1:.2f}€."
          .format(period, -pv)  # '-' tähistab väljaminekut
          )

"""
------------------------------------------------------------------------------
nper (net present value) -- perioodiliste maksete arvu arvutamine
nper(rate, pmt, pv, fv=0, when='end')
开发者ID:priitlatt,项目名称:sissejuhatus-finantsmatemaatikasse,代码行数:31,代码来源:sfm_yl1_intresside_rehkendamine_priit_latt.py


示例15: test_pv

 def test_pv(self):
     assert_almost_equal(np.pv(.10,12,-100,100), 649.51, 2)
开发者ID:radovankavicky,项目名称:econpy,代码行数:2,代码来源:test_finance.py


示例16: myfnc

def myfnc(x):
    return np.pv(x,2,0,125.44)+100.0
开发者ID:cbasurto,项目名称:Intro-to-Python-Coursework,代码行数:2,代码来源:financial.institution.goal.seek.py


示例17:

import numpy as np

np.pv(0.05 / 12, 10 * 12, -100, 15692.93)
a = np.array((0.05, 0.04, 0.03)) / 12
np.pv(a, 10 * 12, -100, 15692.93)
开发者ID:yzozulya,项目名称:numpy_test_examples,代码行数:5,代码来源:numpy.pv.py


示例18: test_pv_decimal

 def test_pv_decimal(self):
     assert_equal(np.pv(Decimal('0.07'), Decimal('20'), Decimal('12000'), Decimal('0')),
                  Decimal('-127128.1709461939327295222005'))
开发者ID:Horta,项目名称:numpy,代码行数:3,代码来源:test_financial.py


示例19: 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


示例20: taux

capital=np.zeros((3, 7))
interets=np.zeros((3, 7))

# Hypothèse de mensualité fixe
mensualite=50.0                     

# Hypothèses de taux (source: meilleurstaux.com au 30/06/2014)
mention=('Bon', 'Très bon', 'Excellent')
duree=np.array(([7, 10, 12, 15, 20, 25, 30])) 
taux=np.array(([0.0223, 0.0245, 0.0263, 0.0281, 0.0300, 0.0337, 0.0425],
      [0.0205, 0.0225, 0.0243, 0.0258, 0.0274, 0.0320, 0.0370],
      [0.0175, 0.0196, 0.0216, 0.0240, 0.0267, 0.0283, 0.0335]))
taux_df=pd.DataFrame(taux, index=mention, columns=duree)
           
for i in range(len(mention)):
    for j in range(len(taux[0])):
        capital[i,j]=np.pv(taux[i,j]/12, duree[j]*12, -mensualite)
        interets[i,j]=mensualite*12*duree[j]-capital[i,j]

# Affichage des résultats
for i in range(len(mention)):
    plt.figure('Taux '+ mention[i])
    plt.title('Taux '+ mention[i])
    plt.grid(color="k")
    plt.xlabel('Durée')
    plt.xlim(5, 31)
    plt.ylabel('Montant (EUR)')
    plt.plot(duree, capital[i], 'b', label='Montant financable')
    plt.plot(duree, interets[i], 'r', label='Interets versés')

plt.show()
开发者ID:milinc,项目名称:ptre,代码行数:31,代码来源:maturite.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python numpy.rad2deg函数代码示例发布时间:2022-05-27
下一篇:
Python numpy.putmask函数代码示例发布时间: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