hollywoodfrancis
commited on
Create test.py
Browse files
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}")
|