philippds commited on
Commit
3be1481
·
verified ·
1 Parent(s): 70bae66

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -158,7 +158,7 @@ def run_update_dataset():
158
  def get_data(rl_env, task_id, path) -> pd.DataFrame:
159
  """
160
  Get data from rl_env, filter by the given task_id, and drop the Task-ID column.
161
- Also drops any columns that have no data (all values are NaN).
162
  :return: filtered data as a pandas DataFrame without the Task-ID column
163
  """
164
  csv_path = path + "/" + rl_env + ".csv"
@@ -176,6 +176,9 @@ def get_data(rl_env, task_id, path) -> pd.DataFrame:
176
  # Drop columns that have no data (all values are NaN)
177
  filtered_data = filtered_data.dropna(axis=1, how='all')
178
 
 
 
 
179
  # Convert User and Model columns to clickable links
180
  for index, row in filtered_data.iterrows():
181
  user_id = row["User"]
 
158
  def get_data(rl_env, task_id, path) -> pd.DataFrame:
159
  """
160
  Get data from rl_env, filter by the given task_id, and drop the Task-ID column.
161
+ Also drops any columns that have no data (all values are NaN) or all values are 0.0.
162
  :return: filtered data as a pandas DataFrame without the Task-ID column
163
  """
164
  csv_path = path + "/" + rl_env + ".csv"
 
176
  # Drop columns that have no data (all values are NaN)
177
  filtered_data = filtered_data.dropna(axis=1, how='all')
178
 
179
+ # Drop columns where all values are 0.0
180
+ filtered_data = filtered_data.loc[:, (filtered_data != 0.0).any(axis=0)]
181
+
182
  # Convert User and Model columns to clickable links
183
  for index, row in filtered_data.iterrows():
184
  user_id = row["User"]