當前位置: 首頁>>代碼示例 >>用法及示例精選 >>正文


Python numpy.npv()用法及代碼示例


numpy.npv(匯率,價值):此財務函數可幫助用戶計算現金流量係列的NPV(淨現值)。

參數:

rate  : [scalar] Rate of discount 
value : [array_like, shape(M,)] value of 
        cash flows time series. The (fixed) time interval 
        between cash flow “events” must be the same as that
        for given rate is given. By convention, investments
        or “deposits” are -ve, income or “withdrawals” are +ve

返回:


present value as per given parameters.

求解方程:

代碼1:工作

## Python program explaining pv() function 
import numpy as np 
  
#            rate            values      
a =  np.npv(0.281,[-100, 19, 49, 58, 200]) 
print("Net Present Value(npv) : ", a)

輸出:

Net Present Value(npv) :  46.5579792365

參考文獻:
https://docs.scipy.org/doc/numpy-1.13.0/reference/generated/numpy.npv.html



相關用法


注:本文由純淨天空篩選整理自Mohit Gupta_OMG 大神的英文原創作品 numpy.npv() in Python。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。