From 717e8438e3c83ef1e46882aa70a99f50bfb2ce8d Mon Sep 17 00:00:00 2001 From: Craig Macdonald Date: Thu, 23 Mar 2023 16:16:35 +0000 Subject: [PATCH] removes two warnings --- pyterrier/index.py | 2 +- pyterrier/text.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyterrier/index.py b/pyterrier/index.py index 8f2ef6c7..f55624f7 100644 --- a/pyterrier/index.py +++ b/pyterrier/index.py @@ -647,7 +647,7 @@ def convertDoc(text_row, meta_column): if text_row is None: text_row = "" hashmap = HashMap() - for column, value in meta_column[1].iteritems(): + for column, value in meta_column[1].items(): if value is None: value = "" hashmap.put(column, value) diff --git a/pyterrier/text.py b/pyterrier/text.py index 50fbe802..caec7b30 100644 --- a/pyterrier/text.py +++ b/pyterrier/text.py @@ -340,7 +340,7 @@ def transform(self, topics_and_res): rtr = rtr.drop(columns=['docno', 'pid']).rename(columns={"olddocno" : "docno"}) if self.agg == 'mean': - rtr = topics_and_res.groupby(['qid', 'olddocno']).mean()['score'].reset_index().rename(columns={'olddocno' : 'docno'}) + rtr = topics_and_res.groupby(['qid', 'olddocno'])['score'].mean().reset_index().rename(columns={'olddocno' : 'docno'}) from .model import query_columns #add query columns back rtr = rtr.merge(topics_and_res[query_columns(topics_and_res)].drop_duplicates(), on='qid')