Summary
How to
Steps to reproduce
Code snippet:
def analyse_style_histo(numero, classe):
# Some stuff from internet
return df
@st.cache_data # I tried this but without success !
def analyse_style(numero, combo):
# Some stuff from internet
return df, r2
def graph_style(df):
return fig
if st.button('Analyse de style', type="primary"):
st.subheader(f"Analyse de style pour le fonds {fonds}")
if classe=='Actions':
style = analyse_style_histo(numero_fonds,
classe)
analyse_style, r2 = analyse_style(numero_fonds, 1)
col = st.columns(2)
col[0].caption('Analyse style par pays')
if len(style[1])!=0: #Test if style is empty data
col[0].plotly_chart(graph_style(style[1]), use_container_width=True)
periode = col[1].radio("PΓ©riode",
analyse_style.columns,
horizontal=True) # buttons to choose which column to print
col[1].dataframe(analyse_style[periode]) # How to print this data without launching again the st.button()
else:
col[0].write('Analyse non pertinente')
My question is simple: how can I do the analysis without to have to relaunch the st.button to print analyse_style[periode]
?
Thanks.