loubnabnl HF staff commited on
Commit
6881bc0
1 Parent(s): 85a8c20

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -22,7 +22,8 @@ def load_data(min_score=1, max_score=10, show_special=False):
22
  def filter_func(x):
23
  try:
24
  score = int(x['educational_score'])
25
- return max(min_score <= score <= max_score, show_special)
 
26
  except (ValueError, TypeError):
27
  # Return True if show_special is checked and educational_score is None or ''
28
  return show_special
@@ -37,7 +38,7 @@ with col_1:
37
  with col_2:
38
  max_value = st.slider('Select maximum educational score', 1, 10, 10, key='max_score')
39
  with col_3:
40
- show_special = st.checkbox('Show clusters with undefined educational score', False)
41
 
42
  # Load data based on slider values and checkbox status
43
  ds = load_data(min_value, max_value, show_special)
 
22
  def filter_func(x):
23
  try:
24
  score = int(x['educational_score'])
25
+ value = False if show_special else min_score <= score <= max_score
26
+ return value
27
  except (ValueError, TypeError):
28
  # Return True if show_special is checked and educational_score is None or ''
29
  return show_special
 
38
  with col_2:
39
  max_value = st.slider('Select maximum educational score', 1, 10, 10, key='max_score')
40
  with col_3:
41
+ show_special = st.checkbox('Show only clusters with undefined educational score', False)
42
 
43
  # Load data based on slider values and checkbox status
44
  ds = load_data(min_value, max_value, show_special)