sasha HF staff commited on
Commit
069ca0e
·
1 Parent(s): d8b9e17

sorting df

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -5,7 +5,8 @@ import plotly.express as px
5
 
6
  def get_plots(task_data):
7
  task_df= pd.read_csv(task_data)
8
- task_df['total_gpu_energy (Wh)'] = task_df['total_gpu_energy']*1000
 
9
  task_df['energy_star'] = pd.cut(task_df['total_gpu_energy (Wh)'], 3, labels=["⭐⭐⭐", "⭐⭐", "⭐"])
10
  task_df = px.scatter(task_df, x="model", y="total_gpu_energy (Wh)", height= 500, width= 800, color = 'energy_star', color_discrete_map={"⭐": 'red', "⭐⭐": "yellow", "⭐⭐⭐": "green"})
11
  return task_df
 
5
 
6
  def get_plots(task_data):
7
  task_df= pd.read_csv(task_data)
8
+ task_df['Total GPU Energy (Wh)'] = task_df['total_gpu_energy']*1000
9
+ task_df = task_df.sort_values(by=['Total GPU Energy (Wh)'])
10
  task_df['energy_star'] = pd.cut(task_df['total_gpu_energy (Wh)'], 3, labels=["⭐⭐⭐", "⭐⭐", "⭐"])
11
  task_df = px.scatter(task_df, x="model", y="total_gpu_energy (Wh)", height= 500, width= 800, color = 'energy_star', color_discrete_map={"⭐": 'red', "⭐⭐": "yellow", "⭐⭐⭐": "green"})
12
  return task_df