mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 06:15:00 +00:00
aider: Sort the grouped columns by descending average.
# Context: USER: sort the grouped columns by descending average ASSISTANT: To sort the grouped columns by descending average, we need to modify the `show_stats` function in the `benchmark/benchmark.py` file. Specifically, we need to sort the `df_grouped` DataFrame by its values in descending order. Here is the change: ```python benchmark/benchmark.py <<<<<<< ORIGINAL df_grouped = df.groupby(["model", "edit_format"])["pass_rate_1"].mean() ======= df_grouped = df.groupby(["model", "edit_format"])["pass_rate_1"].mean().sort_values(ascending=False) >>>>>>> UPDATED ``` This change will sort the grouped DataFrame `df_grouped` by its values in descending order. The `ascending=False` argument in the `sort_values` function ensures that the sorting is done in descending order.
This commit is contained in:
parent
937ee478ad
commit
0c9deaa118
1 changed files with 1 additions and 1 deletions
|
@ -57,7 +57,7 @@ def show_stats(dirnames):
|
|||
df = pd.DataFrame.from_records(rows)
|
||||
df.sort_values(by=["model", "edit_format"], inplace=True)
|
||||
|
||||
df_grouped = df.groupby(["model", "edit_format"])["pass_rate_1"].mean()
|
||||
df_grouped = df.groupby(["model", "edit_format"])["pass_rate_1"].mean().sort_values(ascending=False)
|
||||
fig, ax = plt.subplots(figsize=(10, 6))
|
||||
df_grouped.unstack().plot(kind="barh", ax=ax)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue