Skip to content

Commit

Permalink
improved docs
Browse files Browse the repository at this point in the history
  • Loading branch information
cmacdonald committed Oct 1, 2024
1 parent 9df15d8 commit b09ff20
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pyterrier/apply.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit b09ff20

Please sign in to comment.