Sofi1606 commited on
Commit
d5a6a9c
1 Parent(s): 93cae1b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -12
app.py CHANGED
@@ -12,22 +12,22 @@ for i in range(int(T)):
12
  tasa = st.number_input(f"Tasa de interés nominal para el mes {i+1} (%): ")
13
  tasas.append(tasa)
14
 
15
- z = np.arange(T)
 
16
 
17
- r_d = A * (1 + np.array(tasas) / (12 * 100)) ** z
18
- r_c = A * np.exp(np.array(tasas) * z / (12 * 100))
19
 
20
- print("r_d:", r_d)
21
- print("r_c:", r_c)
 
22
 
23
- new_dict = {"Mes": np.arange(1, T+1),
24
- "Retorno discreto": r_d,
25
- "Retorno continuo": r_c}
26
 
27
- df = pd.DataFrame(new_dict)
28
- st.dataframe(df)
29
-
30
- st.write(f"En {int(T)} meses tendrás: $ {r_c[-1]}")
31
 
32
 
33
 
 
12
  tasa = st.number_input(f"Tasa de interés nominal para el mes {i+1} (%): ")
13
  tasas.append(tasa)
14
 
15
+ if T > 0:
16
+ z = np.arange(T)
17
 
18
+ r_d = A * (1 + np.array(tasas) / (12 * 100)) ** z
19
+ r_c = A * np.exp(np.array(tasas) * z / (12 * 100))
20
 
21
+ new_dict = {"Mes": np.arange(1, T+1),
22
+ "Retorno discreto": r_d,
23
+ "Retorno continuo": r_c}
24
 
25
+ df = pd.DataFrame(new_dict)
26
+ st.dataframe(df)
 
27
 
28
+ st.write(f"En {int(T)} meses tendrás: $ {r_c[-1]}")
29
+ else:
30
+ st.write("Por favor, ingresa un valor de T mayor que 0.")
 
31
 
32
 
33