Skip to content

pool

PoolDefault

pool(self, *, csvpth, thresh=4, **kwargs)

Creates initial pool

Parameters:

Name Type Description Default
csvpth Path

path for csv file

required
thresh int

global filter on low-scoring players

4
**kwargs

keyword arguments for plugins

{}

Returns:

Type Description
DataFrame

DataFrame with columns: player, team, pos, salary, proj

Source code in pangadfs/pool.py
def pool(self, 
         *, 
         csvpth: Path,
         thresh: int = 4,
         **kwargs
         ) -> pd.DataFrame:
    """Creates initial pool

    Args:
        csvpth (Path): path for csv file
        thresh (int): global filter on low-scoring players
        **kwargs: keyword arguments for plugins

    Returns:
        DataFrame with columns:
        player, team, pos, salary, proj

    """
    df = pd.read_csv(csvpth)
    assert set(['player', 'team', 'pos', 'salary', 'proj']).issubset(df.columns)
    df = df.loc[df.proj >= thresh, :]
    return df.sort_values(['pos']).reset_index(drop=True)