Skip to content

Pool

pangadfs.pool

PoolDefault()

Bases: PoolBase

Source code in pangadfs/base.py
def __init__(self):
    logging.getLogger(__name__).addHandler(logging.NullHandler())

pool(*, 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:

DataFrame

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)