diff --git a/pyproject.toml b/pyproject.toml index 6078b4a..27dca92 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,12 @@ name = "pysketball" version = "2.0.0" description = "This is a Python package that scraps tabular ESPN NBA data from https://www.espn.com/nba/stats/player/_/season/2019/seasontype/2 and processes it" -authors = ["Andres Pitta "] +authors = [ + "Andres Pitta ", + "Anand Shankar, ", + "Carlina Kim, ", + "Kenneth Foo, " + ] license = "MIT" readme = "README.md" homepage = "https://github.com/UBC-MDS/pysketball" diff --git a/pysketball/nba_scraper.py b/pysketball/nba_scraper.py index 735982a..0c532b6 100644 --- a/pysketball/nba_scraper.py +++ b/pysketball/nba_scraper.py @@ -19,7 +19,8 @@ def nba_scraper(season_year, season_type="regular", csv_path=None): season_year : int An integer input of the year of interest for the NBA season. season_type : string - A string input of the NBA season type (either "regular" or playoff). + A string input of the NBA season type (either "regular" or + "postseason"). Default is "regular". csv_path_name : string A string input stating the path to store the scraped csv file and diff --git a/pysketball/nba_team_stats.py b/pysketball/nba_team_stats.py index 45551ce..bbc8f53 100644 --- a/pysketball/nba_team_stats.py +++ b/pysketball/nba_team_stats.py @@ -42,6 +42,27 @@ def nba_team_stats(nba_data, stats_filter=None, teams_filter=None, stats_filter = ['GP', '3PM', 'FT%'], teams_filter = ['UTAH', 'PHX', 'DET'], positions_filter = ['C', 'PG']) + {'GP': count mean std min 25% 50% 75% max + Team POS + DET C 2.0 73.5 7.778175 68.0 70.75 73.5 76.25 79.0 + PG 1.0 82.0 NaN 82.0 82.00 82.0 82.00 82.0 + PHX C 1.0 71.0 NaN 71.0 71.00 71.0 71.00 71.0 + UTAH C 1.0 81.0 NaN 81.0 81.00 81.0 81.00 81.0 + PG 1.0 68.0 NaN 68.0 68.00 68.0 68.00 68.0, + '3PM': count mean std min 25% 50% 75% max + Team POS + DET C 2.0 0.05 0.070711 0.0 0.025 0.05 0.075 0.1 + PG 1.0 2.10 NaN 2.1 2.100 2.10 2.100 2.1 + PHX C 1.0 0.00 NaN 0.0 0.000 0.00 0.000 0.0 + UTAH C 1.0 0.00 NaN 0.0 0.000 0.00 0.000 0.0 + PG 1.0 1.20 NaN 1.2 1.200 1.20 1.200 1.2, + 'FT%': count mean std min 25% 50% 75% max + Team POS + DET C 2.0 68.6 13.57645 59.0 63.8 68.6 73.4 78.2 + PG 1.0 86.4 NaN 86.4 86.4 86.4 86.4 86.4 + PHX C 1.0 74.6 NaN 74.6 74.6 74.6 74.6 74.6 + UTAH C 1.0 63.6 NaN 63.6 63.6 63.6 63.6 63.6 + PG 1.0 85.5 NaN 85.5 85.5 85.5 85.5 85.5} """ # Check if nba_data is a DataFrame if not isinstance(nba_data, pd.DataFrame): @@ -109,6 +130,6 @@ def nba_team_stats(nba_data, stats_filter=None, teams_filter=None, stats_filter = [stat for stat in stats_filter if stat not in ( 'NAME', 'TEAM', 'POS')] for stat in stats_filter: - stats[stat] = nba_data.groupby(group_by).describe()[stat] + stats[stat] = nba_data.groupby(group_by).describe().round(3)[stat] return stats