mlabonne commited on
Commit
fd45a63
1 Parent(s): fcc23ad

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -73,7 +73,7 @@ def create_bar_chart(df, category):
73
  x=sorted_df[category],
74
  y=sorted_df['Model'],
75
  orientation='h',
76
- marker=dict(color=sorted_df[category], colorscale='Twilight') # You can change 'Viridis' to another color scale
77
  ))
78
 
79
  # Update layout for better readability
@@ -82,7 +82,7 @@ def create_bar_chart(df, category):
82
  )
83
 
84
  # Adjust the height of the chart based on the number of rows in the DataFrame
85
- st.plotly_chart(fig, use_container_width=True, height=len(df) * 35)
86
 
87
  # Example usage:
88
  # create_bar_chart(your_dataframe, 'Your_Category')
@@ -135,6 +135,9 @@ def main():
135
  if dfs_to_concat:
136
  df = pd.concat(dfs_to_concat, ignore_index=True)
137
 
 
 
 
138
  # Add a search bar
139
  search_query = st.text_input("Search models", "")
140
 
 
73
  x=sorted_df[category],
74
  y=sorted_df['Model'],
75
  orientation='h',
76
+ marker=dict(color=sorted_df[category], colorscale='Inferno')
77
  ))
78
 
79
  # Update layout for better readability
 
82
  )
83
 
84
  # Adjust the height of the chart based on the number of rows in the DataFrame
85
+ st.plotly_chart(fig, use_container_width=True, height=int(len(df) * 34.7))
86
 
87
  # Example usage:
88
  # create_bar_chart(your_dataframe, 'Your_Category')
 
135
  if dfs_to_concat:
136
  df = pd.concat(dfs_to_concat, ignore_index=True)
137
 
138
+ # Sort values
139
+ df = df.sort_values(by='Average', ascending=False)
140
+
141
  # Add a search bar
142
  search_query = st.text_input("Search models", "")
143