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+1) | |
r_d = A * (1 + np.array(tasas) / (12 * 100)) ** z | |
r_c = A * np.exp(np.array(tasas) * z / (12 * 100)) | |
new_dict = {"Mes": z, | |
"Retorno discreto": r_d, | |
"Retorno continuo": r_c} | |
df = pd.DataFrame(new_dict) | |
df.columns = new_dict.keys() | |
st.dataframe(df) | |
st.write(f"En {int(T)} meses tendrás: $ {r_c[-1]}") | |