Update app.py
Browse files
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 |
-
|
|
|
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 |
-
|
21 |
-
|
|
|
22 |
|
23 |
-
|
24 |
-
|
25 |
-
"Retorno continuo": r_c}
|
26 |
|
27 |
-
|
28 |
-
|
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 |
|