f64
commited on
Commit
·
764d922
1
Parent(s):
2523b20
app.py
CHANGED
|
@@ -1,4 +1,15 @@
|
|
| 1 |
import streamlit as st
|
|
|
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
import pandas as pd
|
| 3 |
|
| 4 |
+
df = pd.DataFrame(
|
| 5 |
+
[
|
| 6 |
+
{"command": "st.selectbox", "rating": 4, "is_widget": True},
|
| 7 |
+
{"command": "st.balloons", "rating": 5, "is_widget": False},
|
| 8 |
+
{"command": "st.time_input", "rating": 3, "is_widget": True},
|
| 9 |
+
]
|
| 10 |
+
)
|
| 11 |
+
edited_df = st.data_editor(df, num_rows="dynamic")
|
| 12 |
+
|
| 13 |
+
favorite_command = edited_df.loc[edited_df["rating"].idxmax()]["command"]
|
| 14 |
+
|
| 15 |
+
st.markdown(f"Your favorite command is **{favorite_command}** 🎈")
|