DontPlanToEnd commited on
Commit
58d6da7
1 Parent(s): 11f5f93

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -43,10 +43,12 @@ def update_table(df: pd.DataFrame, query: str, param_ranges: dict) -> pd.DataFra
43
  elif param_range == '~70+':
44
  conditions.append((filtered_df['Params'] >= 60))
45
 
46
- if all(param_ranges.values()):
47
  conditions.append(filtered_df['Params'].isna())
48
 
49
  filtered_df = filtered_df[pd.concat(conditions, axis=1).any(axis=1)]
 
 
50
 
51
  if query:
52
  filtered_df = filtered_df[filtered_df.apply(lambda row: query.lower() in row.to_string().lower(), axis=1)]
 
43
  elif param_range == '~70+':
44
  conditions.append((filtered_df['Params'] >= 60))
45
 
46
+ if all(param_ranges.values()) or not any(param_ranges.values()):
47
  conditions.append(filtered_df['Params'].isna())
48
 
49
  filtered_df = filtered_df[pd.concat(conditions, axis=1).any(axis=1)]
50
+ else:
51
+ filtered_df = filtered_df[filtered_df['Params'].isna() | filtered_df['Params'].notna()]
52
 
53
  if query:
54
  filtered_df = filtered_df[filtered_df.apply(lambda row: query.lower() in row.to_string().lower(), axis=1)]