awacke1 commited on
Commit
7d63b3c
ยท
1 Parent(s): c11db43

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -27,7 +27,12 @@ dice_type = st.selectbox("๐ŸŽฒ Select a dice type", options=list(dice_types.keys
27
  num_rolls = st.slider("๐ŸŽฒ How many times do you want to roll the dice?", 1, 1000000, 100)
28
 
29
  # Create a string with the rolls for the selected dice type
30
- rolls = [str(pd.Series([dice_types[dice_type]["sides"]] * num_rolls).apply(pd.Series.sample, replace=True))]
 
 
 
 
 
31
  rolls = rolls[0].strip('[]').split('\n')
32
 
33
  # Create a button to roll the dice
 
27
  num_rolls = st.slider("๐ŸŽฒ How many times do you want to roll the dice?", 1, 1000000, 100)
28
 
29
  # Create a string with the rolls for the selected dice type
30
+ #orig: rolls = [str(pd.Series([dice_types[dice_type]["sides"]] * num_rolls).apply(pd.Series.sample, replace=True))]
31
+ #replaced:
32
+ rolls = pd.DataFrame([dice_types[dice_type]["sides"]] * num_rolls)[0].apply(pd.Series.sample, replace=True).tolist()
33
+
34
+
35
+ #rolls = [str(pd.Series([dice_types[dice_type]["sides"]] * num_rolls).apply(pd.Series.sample, replace=True))]
36
  rolls = rolls[0].strip('[]').split('\n')
37
 
38
  # Create a button to roll the dice