I am trying to use the st.radio function. I want to have a None Value for the return, as long as the user hasn’t choosen his answer.
Though, it’s not working for now, and i get the following API error:
**StreamlitAPIException**: Selectbox Value has invalid type: NoneType Traceback: File "C:\Users\hdandria\Documents\Gitlab\maintenance-predictive-explicabilite\Anomaly detection with Isolation Forest.py", line 147, in <module> option = st.selectbox( ^^^^^^^^^^^^^
The code that I’m using is the one of the documentation:
import streamlit as st genre = st.radio( "What's your favorite movie genre", [":rainbow[Comedy]", "***Drama***", "Documentary :movie_camera:"], index=None, ) st.write("You selected:", genre)
Note: The st.radio functions behaves properly, as long as I don’t set index as None.
Do you have any idea on the origin of this problem ?