Skip to content

Instantly share code, notes, and snippets.

@ilonacodes
Created June 8, 2021 13:14
Show Gist options
  • Save ilonacodes/cba00d8f86388476166ed9a0999194fd to your computer and use it in GitHub Desktop.
Save ilonacodes/cba00d8f86388476166ed9a0999194fd to your computer and use it in GitHub Desktop.
r = 0.03
cash_flow['PV'] = cash_flow['Cash'] / (1 + r) ** cash_flow['Year']
npv = cash_flow['PV'].sum()
print('NPV is', + round(npv))
# NPV is 1596.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment