I need the selectbox default value to be a string such as: please select and then the data list to be all values of pd.DataFrame. How do I implement this function?
I wanted to add a default boot string to the selectbox to help the user click on the corresponding value, but when I used the DataFrame, I didn’t get what I wanted
After the program runs, the selectbox automatically executes the value of the first line. I want the user to select the corresponding option before executing it. For example, I want the effect to be as follows:
Sorry for the late response on this. It sounds like you’re looking to pass a DataFrame as the options for your st.selectbox, which you can do via the following:
import pandas as pd
import streamlit as st
data = {
"values": [420, 380, 390],
}
df = pd.DataFrame(data)
option = st.selectbox('Select an option ',options=df)