|
import streamlit as st |
|
import numpy as np |
|
import pandas as pd |
|
|
|
st.title('App de prueba') |
|
|
|
A = st.number_input("Escribe la cantidad que ahorrarás ($): ") |
|
T = st.number_input("Escribe cuantos meses quieres ver: ", step=1) |
|
|
|
tasas = [] |
|
for i in range(int(T)): |
|
tasa = st.number_input(f"Tasa de interés nominal para el mes {i+1} (%): ") |
|
tasas.append(tasa) |
|
|
|
z = np.arange(T) |
|
|
|
r_d = A * (1 + np.array(tasas) / (12 * 100)) ** z |
|
r_c = A * np.exp(np.array(tasas) * z / (12 * 100)) |
|
|
|
print("r_d:", r_d) |
|
print("r_c:", r_c) |
|
|
|
new_dict = {"Mes": np.arange(1, T+1), |
|
"Retorno discreto": r_d, |
|
"Retorno continuo": r_c} |
|
|
|
df = pd.DataFrame(new_dict) |
|
st.dataframe(df) |
|
|
|
st.write(f"En {int(T)} meses tendrás: $ {r_c[-1]}") |
|
|
|
|
|
|