Skip to content

Commit

Permalink
Added select slider date
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanji-dev committed Oct 10, 2022
1 parent 64b5010 commit d2c420c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Hello.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import streamlit as st
import pandas as pd
from datetime import date

major_fx = ['EUR','JPY','AUD','NZD','CAD','GBP','CHF']

Expand Down Expand Up @@ -28,11 +29,11 @@

#Lis le fichier CSV en fonction de la devise sélectionnée
df = pd.read_csv(f"csv_folder/{option.lower()}.csv", index_col='Date')
print("ok")
#df.style.background_gradient(axis=0)

st.dataframe(df.style.background_gradient(axis=0), use_container_width=True)
dates = list(df.index)
start = st.select_slider("Date de début", options = dates, value=(dates[-1]))
st.write("Début:", dates.index(start))

st.table(df.head(dates.index(start)+1).style.background_gradient(axis=0))
@st.cache
def convert_df(df):
# IMPORTANT: Cache the conversion to prevent computation on every rerun
Expand All @@ -47,3 +48,4 @@ def convert_df(df):
file_name=f'{option}_{date}.csv',
mime='text/csv',
)

0 comments on commit d2c420c

Please sign in to comment.