Skip to content

Commit

Permalink
Fix unittest warning (#1802)
Browse files Browse the repository at this point in the history
  • Loading branch information
manveertamber authored Mar 2, 2024
1 parent 31b0087 commit bc5b3bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pyserini/trectools/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def reset_data(self):
self.run_data = pd.DataFrame(columns=TrecRun.columns)

def read_run(self, filepath: str, resort: bool = False) -> None:
self.run_data = pd.read_csv(filepath, sep='\s+', names=TrecRun.columns, dtype={'docid': 'str'})
self.run_data = pd.read_csv(filepath, sep='\s+', names=TrecRun.columns, dtype={'docid': 'str', 'score': 'float'})
if resort:
self.run_data.sort_values(["topic", "score"], inplace=True, ascending=[True, False])
self.run_data["rank"] = self.run_data.groupby("topic")["score"].rank(ascending=False,method='first')
Expand Down

0 comments on commit bc5b3bf

Please sign in to comment.