In [11]:
%matplotlib qt4
%matplotlib inline
import scipy as sp
from matplotlib.pyplot import *
cashflows=[-100,50,60,70]
rate=[]
npv=[]
x=(0,0.7)
y=(0,0)
for i in range(1,70):
rate.append(0.01*i)
npv.append(sp.npv(0.01*i,cashflows[1:])+cashflows[0])
plot(rate,npv),plot(x,y)
show()
×
时间: 2024-11-11 09:43:44