I added a radio button in my code.
I would like to know how to make sure that the choice to be made is only displayed at a certain time. In my case when the user enters an input. Indeed the choice is displayed from the beginning as you can see on these pictures. In the first image you can see the choice for all the movies but the choice has to be based only on the movie entered by the user (image 2).
And below is my code :
from the model machine learning file :
def choix_titre(): titre = st.text_input("Please enter your favorite movie") df = df_all[df_all['title'].str.contains(titre.title())] df = df.drop_duplicates(subset=["title", 'year'], keep='first') df = df.reset_index() df = df.drop('index', axis=1) df = df[['title', 'year']] l =  o = df.copy() o["year"] = o["year"].apply(lambda x: str(x)) o["title_year"] = o["title"] + " ("+o["year"]+")" for i in o["title_year"]: l.append(i) status = st.radio("Select your movie", l)
thank you in advance,