Spaces:
Runtime error
Runtime error
LuisLozano
commited on
Commit
•
8740d6f
1
Parent(s):
5ab8b81
Update app.py
Browse files
app.py
CHANGED
@@ -41,12 +41,22 @@ st.write(f"Table with returns at an interest rate of {r}")
|
|
41 |
new_df = st.data_editor(inv_df)
|
42 |
|
43 |
# New numpy array with the returns for each month in t
|
44 |
-
|
45 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
new_df["Returns"] = new_y
|
47 |
|
48 |
# New numpy array with the continuously compunded returns
|
49 |
A_c = new_df["Continuous returns"].shift(1)
|
|
|
50 |
new_y_c = A_c * np.exp(new_df["Rate"] / (12*100))
|
51 |
new_df["Continuous returns"] = new_y_c
|
52 |
|
|
|
41 |
new_df = st.data_editor(inv_df)
|
42 |
|
43 |
# New numpy array with the returns for each month in t
|
44 |
+
A_y = new_df["Returns"].shift(1)
|
45 |
+
|
46 |
+
new_y = [A]
|
47 |
+
|
48 |
+
for i in range(1, len(A_y):
|
49 |
+
r_temp = new_df["Rate"].iloc(i)
|
50 |
+
val = i * (1 + r_temp / (12*100))
|
51 |
+
new_y.append(val)
|
52 |
+
|
53 |
+
|
54 |
+
new_y = A_y * (1 + (new_df["Rate"] / (12*100)))
|
55 |
new_df["Returns"] = new_y
|
56 |
|
57 |
# New numpy array with the continuously compunded returns
|
58 |
A_c = new_df["Continuous returns"].shift(1)
|
59 |
+
|
60 |
new_y_c = A_c * np.exp(new_df["Rate"] / (12*100))
|
61 |
new_df["Continuous returns"] = new_y_c
|
62 |
|