From b09ff20242ae81ab870cf3074a8f692f1f76e230 Mon Sep 17 00:00:00 2001 From: Craig Macdonald Date: Tue, 1 Oct 2024 11:10:39 +0100 Subject: [PATCH] improved docs --- pyterrier/apply.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pyterrier/apply.py b/pyterrier/apply.py index 159c89a3..7e026b0f 100644 --- a/pyterrier/apply.py +++ b/pyterrier/apply.py @@ -172,12 +172,12 @@ def generic(fn : Union[Callable[[pd.DataFrame], pd.DataFrame], Callable[[pt.mode """ Create a transformer that changes the input dataframe to another dataframe in an unspecified way. - The supplied function is called once for an entire result set as a dataframe (which may contain one of more queries). - Each time it should return a new dataframe. The returned dataframe should abide by the general PyTerrier Data Model, - for instance updating the rank column if the scores are amended. + The supplied function is called once for an entire result set as a dataframe or iter-dict (which may contain one or + more queries and one or more documents). Each time it should return a new dataframe. The returned dataframe (or yielded row) + should abide by the general PyTerrier Data Model, for instance updating the rank column if the scores are amended. Arguments: - fn(Callable): the function to apply to each row + fn(Callable): the function to apply to each result set batch_size(int or None): whether to apply fn on batches of rows or all that are received verbose(bool): Whether to display a progress bar over batches (only used if batch_size is set, and iter is not set). iter(bool): Whether to use the iter-dict API - if-so, then ``fn`` receives an iterable, and returns an iterable.