LuisLozano commited on
Commit
885e0f7
1 Parent(s): 024fa15

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -13
app.py CHANGED
@@ -40,26 +40,20 @@ inv_df.columns = inv_dict.keys()
40
  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
- A_y = new_df["Returns"].shift(1)
45
  new_y = [A]
 
46
 
47
- for i in range(1, len(A_y)):
48
  r_temp = new_df["Rate"].values[i]
 
49
  val = new_y[i-1] * (1 + r_temp / (12*100))
50
  new_y.append(val)
51
 
52
- new_df["Returns"] = new_y
53
-
54
- # New numpy array with the continuously compunded returns
55
- A_c = new_df["Continuous returns"].shift(1)
56
- new_y_c = [A]
57
-
58
- for i in range(1, len(A_c)):
59
- r_temp = new_df["Rate"].values[i]
60
- val = new_y_c[i-1] * np.exp(r_temp / (12*100))
61
- new_y_c.append(val)
62
 
 
63
  new_df["Continuous returns"] = new_y_c
64
 
65
  st.dataframe(new_df)
 
40
  st.write(f"Table with returns at an interest rate of {r}")
41
  new_df = st.data_editor(inv_df)
42
 
 
 
43
  new_y = [A]
44
+ new_y_c = [A]
45
 
46
+ for i in range(1, len(t)):
47
  r_temp = new_df["Rate"].values[i]
48
+ # New numpy array with the returns for each month in t
49
  val = new_y[i-1] * (1 + r_temp / (12*100))
50
  new_y.append(val)
51
 
52
+ # New numpy array with the continuously compunded returns
53
+ val_c = new_y_c[i-1] * np.exp(r_temp / (12*100))
54
+ new_y_c.append(val_c)
 
 
 
 
 
 
 
55
 
56
+ new_df["Returns"] = new_y
57
  new_df["Continuous returns"] = new_y_c
58
 
59
  st.dataframe(new_df)