Code: Select all
n = 10. # no of periods
years = np.arange(n) + 1
initial_investment = [-1000]
quantity_sold = np.full(n, 20)
price = np.full(n, 20)
revenue = quantity_sold * price
expense = np.full(n, 50)
cash_flow = np.concatenate([initial_investment, revenue - expense])
verwenden
Code: Select all
npf.irr(cash_flow), npf.npv(0.32975, cash_flow)
# (0.32975, 0.008)
Code: Select all
optimize.root(npf.npv, args=cash_flow, x0=0.5)
< /code>
Aber Cash_Flow ist ein Array, das sogar zulässt, dass die Werte dieses Arrays konstant sind. Wie würde ich für bash_flow