sportsref/nba/pbp.py
def clean_multigame_features(df):
    """TODO: Docstring for clean_multigame_features.

    :df: TODO
    :returns: TODO
    """
    df = pd.DataFrame(df)
    if df.index.value_counts().max() > 1:
        df.reset_index(drop=True, inplace=True)

    df = clean_features(df)

    # if it's many games in one DataFrame, make poss_id and play_id unique
    for col in ('play_id', 'poss_id'):
        diffs = df[col].diff().fillna(0)
        if (diffs < 0).any():
            new_col = np.cumsum(diffs.astype(bool))
            df.eval('{} = @new_col'.format(col), inplace=True)

    return df
def clean_multigame_features(df):
    """TODO: Docstring for clean_multigame_features.

    :df: TODO
    :returns: TODO
    """
    df = pd.DataFrame(df)
    if df.index.value_counts().max() > 1:
        df.reset_index(drop=True, inplace=True)

    df = clean_features(df)

    # if it's many games in one DataFrame, make poss_id and play_id unique
    for col in ('play_id', 'poss_id'):
        diffs = df[col].diff().fillna(0)
        if (diffs < 0).any():
            new_col = np.cumsum(diffs.astype(bool))
            df.eval('{} = @new_col'.format(col), inplace=True)

    return df
TODO: Docstring for clean_multigame_features.

    :df: TODO
    :returns: TODO