f64 commited on
Commit
764d922
·
1 Parent(s): 2523b20
Files changed (1) hide show
  1. app.py +13 -2
app.py CHANGED
@@ -1,4 +1,15 @@
1
  import streamlit as st
 
2
 
3
- x = st.slider('Select a value')
4
- st.write(x, 'squared is', x * x)
 
 
 
 
 
 
 
 
 
 
 
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}** 🎈")