Skip to content

Commit

Permalink
Specify numeric_only=True in groupby.mean() since this default va…
Browse files Browse the repository at this point in the history
…lue has been deprecated
  • Loading branch information
jlbas committed Jun 4, 2024
1 parent e5738f3 commit 83a7fd1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lpsnav/utils/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ def evaluate(self, i, env, fname):
self.tracked_dfs[i][col] = self.df.loc[i, col]

def print_df(self, fname, df):
means = df.groupby("policy", as_index=False).mean()
means = df.groupby("policy", as_index=False).mean(numeric_only=True)
for k, v in [(k, v) for k, v in self.metrics.items() if k in means]:
means[k] = means[k].round(v.decimals)
means[k] = means[k].map(lambda x: f"<{x}>" if x == v.opt_func(means[k]) else x)
Expand Down

0 comments on commit 83a7fd1

Please sign in to comment.