Skip to content

Commit

Permalink
Fix Pandas >= 2.0.0 change in default GroupBy behaviour.
Browse files Browse the repository at this point in the history
From Pandas changelog:
"Changed default of numeric_only in various DataFrameGroupBy methods; all methods now default to numeric_only=False (GH46072)."
See pandas-dev/pandas#46072
  • Loading branch information
carlescn committed Jun 12, 2023
1 parent 41e5221 commit 83ce935
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions PrivateDataset/cluster_deep.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,7 @@
"# Save the ametrics on a CSV file\n",
"results.to_csv(\"results/metrics_deepclust.csv\", index=False)\n",
"\n",
"results_mean = results.set_index([\"rl_method\",\"clust_method\"]).groupby(level=[0,1]).mean()\n",
"results_mean = results.set_index([\"rl_method\",\"clust_method\"]).groupby(level=[0,1]).mean(numeric_only=True)\n",
"results_mean = results_mean.iloc[:,1:]\n",
"metrics=['same_clust','Acc','ARI','AMI','Sil']\n",
"results_mean.style.background_gradient(axis=0, cmap=\"cividis\", text_color_threshold=0.3, subset=metrics).format('{:.2f}', subset=metrics)"
Expand Down Expand Up @@ -1372,7 +1372,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
"version": "3.11.3"
},
"toc-autonumbering": true
},
Expand Down

0 comments on commit 83ce935

Please sign in to comment.