Last active
June 8, 2021 13:10
-
-
Save ilonacodes/188483d747848d3c8d199da2e96ecfa0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import numpy as np | |
import matplotlib.pyplot as plt | |
r = 0.03 | |
cash_flow = pd.DataFrame({'Year': [1, 2, 3, 4, 5, 6], | |
'Cash': [200, 200, 200, 200, 200, 200]}) | |
# PV (Present Value) = Cash (at period 1) / (1 + r)^n | |
cash_flow['PV'] = cash_flow['Cash'] / (1.0 + r) ** cash_flow['Year'] | |
npv = cash_flow['PV'].sum() | |
print(round(cash_flow)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment