hollywoodfrancis commited on
Commit
1919895
·
verified ·
1 Parent(s): 9bd058b

Create test.py

Browse files
Files changed (1) hide show
  1. test.py +11 -0
test.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Example: Calculate NPV
2
+ import numpy as np
3
+
4
+ def calculate_npv(cash_flows, discount_rate):
5
+ return np.npv(discount_rate, cash_flows)
6
+
7
+ # Example usage
8
+ cash_flows = [-1000, 300, 400, 500]
9
+ discount_rate = 0.1
10
+ npv = calculate_npv(cash_flows, discount_rate)
11
+ print(f"NPV: {npv}")