Drop files here
or click to upload
import pandas as pd
import streamlit as st
df = pd.DataFrame(
[
{"command": "st.selectbox", "rating": 4, "is_widget": True, "List": [1,4,7]},
{"command": "st.balloons", "rating": 5, "is_widget": False,"List": [1,4,7]},
{"command": "st.time_input", "rating": 3, "is_widget": True, "List": [1,4,7]},
]
)
edited_df = st.data_editor(
df,
column_config={
"command": "Streamlit Command",
"rating": st.column_config.NumberColumn(
"Your rating",
help="How much do you like this command (1-5)?",
min_value=1,
max_value=5,
step=1,
format="%d ⭐",
),
"is_widget": "Widget ?",
"List": st.column_config.JsonColumn(
"list",
help="aaa"
),
},
num_rows="dynamic", # Or "dynamic"
disabled=[], # ["command", "is_widget"]
hide_index=True,
row_height=None,
key="parameter_ranges"
)
favorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]
st.markdown(f"Your favorite command is **{favorite_command}** 🎈")
Hi! I can help you with any questions about Streamlit and Python. What would you like to know?