diff --git a/docs/source/conf.py b/docs/source/conf.py
index 5c4ae71..185dae3 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -48,18 +48,18 @@
master_doc = 'index'
# General information about the project.
-project = u'sportsref'
-copyright = u'2016, Matt Goldberg'
-author = u'Matt Goldberg'
+project = 'sportsref'
+copyright = '2016, Matt Goldberg'
+author = 'Matt Goldberg'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
-version = u''
+version = ''
# The full version, including alpha/beta/rc tags.
-release = u''
+release = ''
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
@@ -129,8 +129,8 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
- (master_doc, 'sportsref.tex', u'sportsref Documentation',
- u'Matt Goldberg', 'manual'),
+ (master_doc, 'sportsref.tex', 'sportsref Documentation',
+ 'Matt Goldberg', 'manual'),
]
@@ -139,7 +139,7 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
- (master_doc, 'sportsref', u'sportsref Documentation',
+ (master_doc, 'sportsref', 'sportsref Documentation',
[author], 1)
]
@@ -150,7 +150,7 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
- (master_doc, 'sportsref', u'sportsref Documentation',
+ (master_doc, 'sportsref', 'sportsref Documentation',
author, 'sportsref', 'One line description of project.',
'Miscellaneous'),
]
diff --git a/requirements.txt b/requirements.txt
index 6f726ff..c8c86ba 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,105 +1,61 @@
appdirs==1.4.3
appnope==0.1.0
-argh==0.26.2
-backports-abc==0.5
-backports.shutil-get-terminal-size==1.0.0
-bleach==1.5.0
-boltons==17.0.0
-boto3==1.4.3
-botocore==1.4.93
-certifi==2016.9.26
-click==6.7
-cloudpickle==0.2.2
-configparser==3.5.0
-cssselect==1.0.0
-cycler==0.10.0
-dask==0.13.0
-decorator==4.0.10
-distributed==1.15.0
-docutils==0.13.1
-entrypoints==0.2.2
-enum34==1.1.6
-functools32==3.2.3.post2
+bleach==2.1.2
+boltons==17.2.0
+certifi==2018.1.18
+chardet==3.0.4
+cssselect==1.0.3
+decorator==4.2.1
+entrypoints==0.2.3
future==0.16.0
-futures==3.0.5
-graphviz==0.5.2
-HeapDict==1.0.0
-html5lib==0.9999999
-invoke==0.14.0
-ipdb==0.10.1
-ipykernel==4.5.2
-ipython==5.1.0
-ipython-genutils==0.1.0
-ipywidgets==5.2.2
-Jinja2==2.8.1
-jmespath==0.9.0
-jsonschema==2.5.1
+html5lib==1.0.1
+idna==2.6
+ipdb==0.10.3
+ipykernel==4.8.0
+ipython==6.2.1
+ipython-genutils==0.2.0
+ipywidgets==7.1.1
+jedi==0.11.1
+Jinja2==2.10
+jsonschema==2.6.0
jupyter==1.0.0
-jupyter-client==4.4.0
-jupyter-console==5.0.0
-jupyter-core==4.2.1
-livereload==2.5.0
-locket==0.2.0
-lxml==3.7.1
-MarkupSafe==0.23
-matplotlib==2.0.0
-mementos==1.2.6
-mistune==0.7.3
-msgpack-python==0.4.8
-nbconvert==5.0.0
-nbformat==4.2.0
-notebook==4.3.1
-numexpr==2.6.2
-numpy==1.12.0
-packaging==16.8
-pandas==0.19.2
-pandocfilters==1.4.1
-partd==0.3.7
-pathlib2==2.1.0
-pathtools==0.1.2
-patsy==0.4.1
-pexpect==4.2.1
+jupyter-client==5.2.2
+jupyter-console==5.2.0
+jupyter-core==4.4.0
+lxml==4.1.1
+MarkupSafe==1.0
+mementos==1.2.8
+mistune==0.8.3
+nbconvert==5.3.1
+nbformat==4.4.0
+notebook==5.4.0
+numexpr==2.6.4
+numpy==1.14.0
+pandas==0.22.0
+pandocfilters==1.4.2
+parso==0.1.1
+pexpect==4.3.1
pickleshare==0.7.4
-pluggy==0.4.0
-port-for==0.3.1
-prompt-toolkit==1.0.9
-psutil==5.0.1
-ptyprocess==0.5.1
-Pweave==0.25
-py==1.4.32
-Pygments==2.1.3
-pyparsing==2.1.10
-pyquery==1.2.17
-pytest==3.0.5
-python-dateutil==2.6.0
-pytz==2016.10
-PyYAML==3.12
-pyzmq==16.0.2
-qtconsole==4.2.1
-requests==2.13.0
-s3fs==0.0.8
-s3transfer==0.1.10
-scikit-learn==0.18.1
-scipy==0.18.1
+prompt-toolkit==1.0.15
+ptyprocess==0.5.2
+Pygments==2.2.0
+pyquery==1.4.0
+python-dateutil==2.6.1
+pytz==2017.3
+pyzmq==16.0.4
+qtconsole==4.3.1
+requests==2.18.4
+scipy==1.0.0
+Send2Trash==1.4.2
simplegeneric==0.8.1
-singledispatch==3.4.0.3
-six==1.10.0
-sklearn==0.0
-sortedcollections==0.4.2
-sortedcontainers==1.5.7
-sphinx-autobuild==0.6.0
--e git+git@github.com:mdgoldberg/sportsref.git@cfb9edb89da9eeb99ef54d149d32f4e99b7e2087#egg=sportsref
-statsmodels==0.6.1
-subprocess32==3.2.7
-tblib==1.3.0
-terminado==0.6
-testpath==0.3
-toolz==0.8.2
-tornado==4.4.2
-tox==2.5.0
-traitlets==4.3.1
-virtualenv==15.1.0
-watchdog==0.8.3
+six==1.11.0
+sportsref==0.9.1
+terminado==0.8.1
+testpath==0.3.1
+tornado==4.5.3
+traitlets==4.3.2
+urllib3==1.22
wcwidth==0.1.7
-widgetsnbextension==1.2.6
-zict==0.1.1
+webencodings==0.5.1
+widgetsnbextension==3.1.3
+yapf==0.20.1
diff --git a/setup.py b/setup.py
index b64432a..5226a46 100644
--- a/setup.py
+++ b/setup.py
@@ -1,7 +1,7 @@
from setuptools import setup, find_packages
setup(name='sportsref',
- version='0.9.1',
+ version='0.10.0',
description='Scraping data from sports-reference.com and related sites',
url='https://github.com/mdgoldberg/sportsref',
author='Matt Goldberg',
diff --git a/sportsref/euro/__init__.py b/sportsref/euro/__init__.py
new file mode 100644
index 0000000..b9ff399
--- /dev/null
+++ b/sportsref/euro/__init__.py
@@ -0,0 +1,22 @@
+from . import boxscores
+from . import pbp
+from . import seasons
+from . import teams
+
+from .boxscores import BoxScore
+from .seasons import Season
+from .teams import Team
+from .players import Player
+
+BASE_URL = 'http://www.basketball-reference.com/euro'
+
+LEAGUE_IDS = ['greek-basket-league','eurocup','spain-liga-acb','italy-basket-serie-a','france-lnb-pro-a','euroleague']
+
+__all__ = [
+ 'LEAGUE_IDS',
+ 'BASE_URL',
+ 'boxscores', 'BoxScore',
+ 'seasons', 'Season',
+ 'teams', 'Team',
+ 'players', 'Player',
+]
diff --git a/sportsref/euro/boxscores.py b/sportsref/euro/boxscores.py
new file mode 100644
index 0000000..e6f3243
--- /dev/null
+++ b/sportsref/euro/boxscores.py
@@ -0,0 +1,167 @@
+import future
+import future.utils
+
+import datetime
+import re
+
+import numpy as np
+import pandas as pd
+from pyquery import PyQuery as pq
+
+import sportsref
+
+
+class BoxScore(
+ future.utils.with_metaclass(sportsref.decorators.Cached, object)
+):
+
+ def __init__(self, boxscore_id):
+ self.boxscore_id = boxscore_id
+
+ def __eq__(self, other):
+ return self.boxscore_id == other.boxscore_id
+
+ def __hash__(self):
+ return hash(self.boxscore_id)
+
+ def __repr__(self):
+ return 'BoxScore({})'.format(self.boxscore_id)
+
+ @sportsref.decorators.memoize
+ def get_main_doc(self):
+ url = ('{}/boxscores/{}.htm'
+ .format(sportsref.euro.BASE_URL, self.boxscore_id))
+ doc = pq(sportsref.utils.get_html(url))
+ return doc
+
+ @sportsref.decorators.memoize
+ def get_subpage_doc(self, page):
+ url = (sportsref.nba.BASE_URL +
+ '/boxscores/{}/{}.htm'.format(page, self.boxscore_id))
+ doc = pq(sportsref.utils.get_html(url))
+ return doc
+
+ @sportsref.decorators.memoize
+ def date(self):
+ """Returns the date of the game. See Python datetime.date documentation
+ for more.
+ :returns: A datetime.date object with year, month, and day attributes.
+ """
+ match = re.match(r'(\d{4})-(\d{2})-(\d{2})', self.boxscore_id)
+ year, month, day = list(map(int, match.groups()))
+ return datetime.date(year=year, month=month, day=day)
+
+ @sportsref.decorators.memoize
+ def weekday(self):
+ days = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday',
+ 'Saturday', 'Sunday']
+ date = self.date()
+ wd = date.weekday()
+ return days[wd]
+
+ @sportsref.decorators.memoize
+ def get_raw_id(self, home):
+ """Returns home team ID.
+ :returns: string representing home team's ID.
+ """
+ doc = self.get_main_doc()
+ div = doc('.scorebox')
+
+ a_list = []
+ for a in div('a').items():
+ href = a.attr('href')
+ if 'teams' in href:
+ a_list.append(href)
+
+ if home:
+ return a_list[1]
+ return a_list[0]
+
+ @sportsref.decorators.memoize
+ def get_score(self, home):
+ """Returns home team ID.
+ :returns: string representing home team's ID.
+ """
+ doc = self.get_main_doc()
+ div = doc('.scorebox')
+
+ scores = []
+ for d in div('.score').items():
+ scores.append(int(d.text()))
+
+ if home:
+ return scores[1]
+ return scores[0]
+
+
+ @sportsref.decorators.memoize
+ def home(self):
+ """Returns home team ID.
+ :returns: string representing home team's ID.
+ """
+
+ l = self.get_raw_id(home=True)
+ return l.split('/')[3]
+
+ @sportsref.decorators.memoize
+ def away(self):
+ """Returns away team ID.
+ :returns: string representing away team's ID.
+ """
+
+ l = self.get_raw_id(home=False)
+ return l.split('/')[3]
+
+ @sportsref.decorators.memoize
+ def home_score(self):
+ """Returns score of the home team.
+ :returns: int of the home score.
+ """
+ return self.get_score(home=True)
+
+ @sportsref.decorators.memoize
+ def away_score(self):
+ """Returns score of the away team.
+ :returns: int of the away score.
+ """
+ return self.get_score(home=False)
+
+ @sportsref.decorators.memoize
+ def winner(self):
+ """Returns the team ID of the winning team. Returns NaN if a tie."""
+ hmScore = self.home_score()
+ awScore = self.away_score()
+ if hmScore > awScore:
+ return self.home()
+ elif hmScore < awScore:
+ return self.away()
+ else:
+ return None
+
+ @sportsref.decorators.memoize
+ def season(self):
+ """
+ Returns the year ID of the season in which this game took place.
+
+ :returns: An int representing the year of the season.
+ """
+ l = self.get_raw_id(home=True)
+ return l.split('/')[4].replace('.html','')
+
+ @sportsref.decorators.memoize
+ def get_home_stats(self):
+ doc = self.get_main_doc()
+ table = doc('table#{}'.format('box-score-home'))
+ df = sportsref.utils.parse_table(table)
+
+ return df
+
+ @sportsref.decorators.memoize
+ def get_away_stats(self):
+ doc = self.get_main_doc()
+ table = doc('table#{}'.format('box-score-visitor'))
+ df = sportsref.utils.parse_table(table)
+
+ return df
+
+
diff --git a/sportsref/euro/players.py b/sportsref/euro/players.py
new file mode 100644
index 0000000..b339eec
--- /dev/null
+++ b/sportsref/euro/players.py
@@ -0,0 +1,212 @@
+import future
+import future.utils
+
+import datetime
+import re
+import requests
+
+import numpy as np
+from pyquery import PyQuery as pq
+
+import sportsref
+
+__all__ = [
+ 'Player',
+]
+
+
+class Player(future.utils.with_metaclass(sportsref.decorators.Cached, object)):
+
+ """Each instance of this class represents an Euro player, uniquely
+ identified by a player ID. The instance methods give various data available
+ from the player's Sports Reference player page."""
+
+ def __init__(self, player_id):
+ self.player_id = player_id
+ self.main_url = self.get_main_url(player_id)
+
+ def get_main_url(self, player_id):
+ return (sportsref.euro.BASE_URL + '/players/{0}.htm').format(player_id)
+
+ def __eq__(self, other):
+ return self.player_id == other.player_id
+
+ def __hash__(self):
+ return hash(self.player_id)
+
+ def __repr__(self):
+ return 'Player({})'.format(self.player_id)
+
+ def __str__(self):
+ return self.name()
+
+ @sportsref.decorators.memoize
+ def get_main_doc(self, level='B'):
+ #Need to have a level option this deep in process because all vs club vs tourney means a completely different doc for euro, instead of nba which is just a different table and same doc
+
+ player_id = self.player_id
+ if level == 'C':
+ player_id += '-club'
+ if level == 'E':
+ player_id += '-tournament'
+ return pq(sportsref.utils.get_html(self.get_main_url(player_id)))
+
+ @sportsref.decorators.memoize
+ def get_gamelog_doc(self, year, league):
+ url = '{}/pgl_euro.cgi?player_id={}&year_id={}&lg_id={}'.format(sportsref.euro.BASE_URL, self.player_id, year, league)
+ return pq(sportsref.utils.get_html(url))
+
+ @sportsref.decorators.memoize
+ def available_gamelogs(self):
+
+ tup_list = []
+ doc = self.get_main_doc()
+ for li in doc('#bottom_nav_container')('ul')('li').items():
+ href = li('a').attr('href')
+ if href and 'pgl_euro.cgi?' in href:
+ tup_list.append((int(re.search(r'year_id=(.*?)&', href).group(1)), re.search(r'lg_id=(.*?)$', href).group(1)))
+
+ return tup_list
+
+ @sportsref.decorators.memoize
+ def name(self):
+ """Returns the name of the player as a string."""
+ doc = self.get_main_doc()
+ return doc('h1[itemprop="name"]').text().replace(' Europe Stats', '')
+
+ @sportsref.decorators.memoize
+ def age(self, year, month=2, day=1):
+ """Returns the age of the player on a given date.
+
+ :year: int representing the year.
+ :month: int representing the month (1-12).
+ :day: int representing the day within the month (1-31).
+ :returns: Age in years as a float.
+ """
+ doc = self.get_main_doc()
+ date_string = doc('span[itemprop="birthDate"]').attr('data-birth')
+ regex = r'(\d{4})\-(\d{2})\-(\d{2})'
+ date_args = list(map(int, re.match(regex, date_string).groups()))
+ birth_date = datetime.date(*date_args)
+ age_date = datetime.date(year=year, month=month, day=day)
+ delta = age_date - birth_date
+ age = delta.days / 365.
+ return age
+
+ @sportsref.decorators.memoize
+ def position(self):
+ """Returns the position of a player (note: not consistently coded in bballref)
+ :returns: Position
+ """
+ doc = self.get_main_doc()
+ raw = doc('p:contains("Position:")').text()
+ pos = raw.split()[1]
+ return pos
+
+ @sportsref.decorators.memoize
+ def nba_id(self):
+ """Returns the euro player's NBA bballref id if they played in the NBA, None if they haven't
+ :returns: NBA_ID
+ """
+ doc = self.get_main_doc()
+ p = doc('p:contains("NBA Career:")')
+ href = ''
+ for a in p('a').items():
+ href = a.attr('href')
+
+ if href == '':
+ return None
+
+ nba_id = href.split('/')[3].replace('.html', '')
+
+ return nba_id
+
+ @sportsref.decorators.memoize
+ def height(self):
+ """Returns the player's height (in inches).
+ :returns: An int representing a player's height in inches.
+ """
+ doc = self.get_main_doc()
+ raw = doc('span[itemprop="height"]').text()
+ try:
+ feet, inches = list(map(int, raw.split('-')))
+ return feet * 12 + inches
+ except ValueError:
+ return None
+
+ @sportsref.decorators.memoize
+ def weight(self):
+ """Returns the player's weight (in pounds).
+ :returns: An int representing a player's weight in pounds.
+ """
+ doc = self.get_main_doc()
+ raw = doc('span[itemprop="weight"]').text()
+ try:
+ weight = re.match(r'(\d+)lb', raw).group(1)
+ return int(weight)
+ except ValueError:
+ return None
+
+ @sportsref.decorators.kind_rpb(include_type=True)
+ def _get_stats_table(self, table_id, kind='R', level='B', summary=False):
+ """Gets a stats table from the player page; helper function that does
+ the work for per-game, per-36-min, etc. stats.
+
+ :table_id: the ID of the HTML table.
+ :kind: specifies regular season, playoffs. One of 'R', 'P'.
+ Defaults to 'R'.
+ :level: specifies Club play (C), Eurocup/Euroleague play (E), or Both (B) - defaults to B
+ :returns: A DataFrame of stats.
+ """
+ doc = self.get_main_doc(level=level)
+ if level == 'E':
+ table_id = 'table#{}EUR0'.format(table_id)
+ elif level == 'C':
+ table_id = 'table#{}{}'.format(table_id, 'CLU1' if kind == 'P' else 'CLU0')
+ else:
+ table_id = 'table#{}{}'.format(table_id, 'ALL1' if kind == 'P' else 'ALL0')
+
+ table = doc(table_id)
+ df = sportsref.utils.parse_table(table, flatten=(not summary), footer=summary)
+ return df
+
+ @sportsref.decorators.memoize
+ def stats_per_game(self, kind='R', level='B', summary=False):
+ """Returns a DataFrame of per-game box score stats."""
+ return self._get_stats_table('per_game', kind=kind, level=level, summary=summary)
+
+ @sportsref.decorators.memoize
+ def stats_totals(self, kind='R', level='B', summary=False):
+ """Returns a DataFrame of total box score statistics by season."""
+ return self._get_stats_table('totals', kind=kind, level=level, summary=summary)
+
+ @sportsref.decorators.memoize
+ def stats_per36(self, kind='R', level='B', summary=False):
+ """Returns a DataFrame of per-36-minutes stats."""
+ return self._get_stats_table('per_minute', kind=kind, level=level, summary=summary)
+
+ @sportsref.decorators.memoize
+ def stats_advanced(self, kind='R', summary=False):
+ """Returns a dataframe of advanced stats.
+ :returns: TODO (would need to pull from team page, not housed in player page)
+ """
+ raise Exception('not yet implemented - euro.stats_advanced')
+
+ @sportsref.decorators.memoize
+ @sportsref.decorators.kind_rpb(include_type=False)
+ def gamelog_basic(self, year, league):
+ """Returns a table of a player's basic game-by-game stats for a season.
+
+ :param year: The year representing the desired season.
+ :param kind: specifies regular season, playoffs, or both. One of 'R',
+ 'P', 'B'. Defaults to 'R'.
+ :returns: A DataFrame of the player's standard boxscore stats from each
+ game of the season.
+ :rtype: pd.DataFrame
+ """
+
+ doc = self.get_gamelog_doc(year, league)
+
+ table = doc('table#pgl_basic')
+ df = sportsref.utils.parse_table(table)
+ return df
diff --git a/sportsref/euro/seasons.py b/sportsref/euro/seasons.py
new file mode 100644
index 0000000..29188ae
--- /dev/null
+++ b/sportsref/euro/seasons.py
@@ -0,0 +1,143 @@
+import future
+import future.utils
+
+import pandas as pd
+from pyquery import PyQuery as pq
+
+import sportsref
+
+
+class Season(future.utils.with_metaclass(sportsref.decorators.Cached, object)):
+
+ """Object representing a given Euro season."""
+
+ def __init__(self, year, league_id):
+ """Initializes a Season object for an Euro season.
+
+ :year: The year of the season we want.
+ :league_id: The league_id that we want (list of league_ids can be obtained by euro.LEAGUE_IDS
+ """
+ self.yr = int(year)
+ self.lg_id = league_id
+
+ def __eq__(self, other):
+ return (self.yr == other.yr and self.lg_id == other.lg_id)
+
+ def __hash__(self):
+ return hash(self.yr)
+
+ def __repr__(self):
+ return 'Season({})'.format(self.yr)
+
+ def _schedule_url(self):
+ return (sportsref.euro.BASE_URL +
+ '/{}/{}-schedule.htm'.format(self.lg_id, self.yr))
+
+ @sportsref.decorators.memoize
+ def get_main_doc(self):
+ """Returns PyQuery object for the main season URL.
+ :returns: PyQuery object.
+ """
+ url = (sportsref.euro.BASE_URL +
+ '/{}/{}.htm'.format(self.lg_id, self.yr))
+ return pq(sportsref.utils.get_html(url))
+
+ @sportsref.decorators.memoize
+ def get_schedule_doc(self):
+ """Returns PyQuery object for a given schedule URL.
+ :returns: PyQuery object.
+ """
+ html = sportsref.utils.get_html(self._schedule_url())
+ return pq(html)
+
+ @sportsref.decorators.memoize
+ def get_team_ids(self):
+ """Returns a list of the team IDs for the given year.
+ :returns: List of team IDs.
+ """
+ df = self.team_stats_per_game()
+ if not df.empty:
+ return df.index.tolist()
+ else:
+ print('ERROR: no teams found')
+ return []
+
+ @sportsref.decorators.memoize
+ def team_ids_to_names(self):
+ """Mapping from team IDs to full team names.
+ :returns: Dictionary with team IDs as keys and full team strings as
+ values.
+ """
+ doc = self.get_main_doc()
+ table = doc('table#team_stats_per_game')
+ for a in table('a').items():
+ a.removeAttr('href')
+
+ name_table = sportsref.utils.parse_table(table)
+ id_table = self.team_stats_per_game()
+
+ team_ids = id_table.index.values
+ team_names = name_table['team_name_season']
+ if len(team_names) != len(team_ids):
+ raise Exception("team names and team IDs don't align")
+ return dict(list(zip(team_ids, team_names)))
+
+ @sportsref.decorators.memoize
+ def team_names_to_ids(self):
+ """Mapping from full team names to team IDs.
+ :returns: Dictionary with tean names as keys and team IDs as values.
+ """
+ d = self.team_ids_to_names()
+ return {v: k for k, v in list(d.items())}
+
+ @sportsref.decorators.memoize
+ @sportsref.decorators.kind_rpb(include_type=True)
+ def schedule(self, kind='R'):
+ """Returns a list of BoxScore IDs for every game in the season.
+ Only needs to handle 'R' or 'P' options because decorator handles 'B'.
+
+ :param kind: 'R' for regular season (club play), 'P' for playoffs (euroleague), 'B' for both.
+ Defaults to 'R'.
+ :returns: DataFrame of schedule information.
+ :rtype: pd.DataFrame
+ """
+ doc = self.get_schedule_doc()
+ table_id = 'table#games'
+ if kind == 'P':
+ table_id += '_playoffs'
+
+ table = doc(table_id)
+ df = sportsref.utils.parse_table(table)
+ return df
+
+
+ @sportsref.decorators.memoize
+ def _get_team_stats_table(self, selector):
+ """Helper function for stats tables on season pages. Returns a
+ DataFrame."""
+ doc = self.get_main_doc()
+ table = doc(selector)
+ df = sportsref.utils.parse_table(table)
+ df['team_name_season'] = df['team_name_season'].apply(lambda x: x.split('/')[3])
+ df.rename(columns={'team_name_season' : 'team_id'}, inplace=True)
+ df.set_index('team_id', inplace=True)
+ return df
+
+ def standings(self):
+ """Returns a Pandas DataFrame of each team's basic per-game stats for
+ the season."""
+
+ if self.lg_id == 'eurocup' or self.lg_id == 'euroleague':
+ return self._get_team_stats_table('table#tournament_standings')
+ else:
+ return self._get_team_stats_table('table#league_standings')
+
+ def team_stats_totals(self):
+ """Returns a Pandas DataFrame of each team's basic per-game stats for
+ the season."""
+ return self._get_team_stats_table('table#team_stats_totals')
+
+ def team_stats_per_game(self):
+ """Returns a Pandas DataFrame of each team's basic per-game stats for
+ the season."""
+ return self._get_team_stats_table('table#team_stats_per_game')
diff --git a/sportsref/euro/teams.py b/sportsref/euro/teams.py
new file mode 100644
index 0000000..4822e31
--- /dev/null
+++ b/sportsref/euro/teams.py
@@ -0,0 +1,129 @@
+import future
+import future.utils
+
+import numpy as np
+from pyquery import PyQuery as pq
+
+import sportsref
+
+
+class Team(future.utils.with_metaclass(sportsref.decorators.Cached, object)):
+
+ def __init__(self, team_id):
+ self.team_id = team_id
+
+ def __eq__(self, other):
+ return (self.team_id == other.team_id)
+
+ def __hash__(self):
+ return hash(self.team_id)
+
+ @sportsref.decorators.memoize
+ def team_year_url(self, year, level='B'):
+ yr_str = str(year)
+ if level == 'C':
+ yr_str += '_' + self.get_league_id(year=year)
+ elif level == 'E':
+ yr_str += '_euroleague'
+
+
+ return (sportsref.euro.BASE_URL +
+ '/teams/{}/{}.htm'.format(self.team_id, yr_str))
+
+ @sportsref.decorators.memoize
+ def schedule_url(self, year):
+ return (sportsref.euro.BASE_URL + '/schedules/{}/{}.htm'.format(self.team_id, year))
+
+ @sportsref.decorators.memoize
+ def get_main_doc(self):
+ relURL = '/teams/{}'.format(self.team_id)
+ teamURL = sportsref.euro.BASE_URL + relURL
+ mainDoc = pq(sportsref.utils.get_html(teamURL))
+ return mainDoc
+
+ @sportsref.decorators.memoize
+ def get_year_doc(self, yr_str, level='B'):
+ return pq(sportsref.utils.get_html(self.team_year_url(yr_str, level=level)))
+
+ @sportsref.decorators.memoize
+ def get_schedule_doc(self, year):
+ return pq(sportsref.utils.get_html(self.schedule_url(year)))
+
+ @sportsref.decorators.memoize
+ def get_league_id(self, year=2018):
+ """ Year parameter here in case team switched club-play leagues - also makes it easier to find in doc"""
+ doc = self.get_main_doc()
+ table = doc('table#team-index-club')
+
+ start = '/euro/'
+ end = '/{}.html'.format(year)
+
+ for a in table('a[href$="{}"]'.format(end)).items():
+ if 'years' not in a.attr('href'):
+ return a.attr('href')[len(start):-len(end)]
+
+ @sportsref.decorators.memoize
+ def name(self):
+ """Returns the real name of the franchise given the team ID.
+
+ Example:
+ 'barcelona' -> 'FC Barcelona'
+
+ :returns: A string corresponding to the team's full name.
+ """
+ doc = self.get_main_doc()
+ name = doc('title').text().replace(' Seasons | Basketball-Reference.com', '')
+ return name
+
+ def get_stats_table(self, table_id, year, level='B'):
+ doc = self.get_year_doc(year, level=level)
+ table = doc('table#{}'.format(table_id))
+ df = sportsref.utils.parse_table(table)
+
+ return df
+
+ @sportsref.decorators.memoize
+ @sportsref.decorators.kind_rpb(include_type=True)
+ def schedule(self, year, kind='B'):
+ """Returns the teams schedule, with boxscore_ids for further investigation.
+ :returns: schedule Dataframe
+ """
+ doc = self.get_schedule_doc(year)
+ for t in doc('table').items():
+ if self.team_id in t.attr('id'):
+ if 'Euroleague' in t.attr('id'):
+ e_id = t.attr('id')
+ else:
+ c_id = t.attr('id')
+ if kind == 'R':
+ table_id = c_id
+
+ else:
+ table_id = e_id
+
+ table = doc("table[id='{}']".format(table_id))
+ df = sportsref.utils.parse_table(table)
+ df.rename(columns={'date_game_full' : 'boxscore_id'}, inplace=True)
+ return df
+
+
+ @sportsref.decorators.memoize
+ def all_team_opp_stats(self, year, level='B'):
+ return self.get_stats_table('team_and_opp', year, level=level)
+
+ @sportsref.decorators.memoize
+ def stats_per_game(self, year, level='B'):
+ return self.get_stats_table('per_game', year, level=level)
+
+ @sportsref.decorators.memoize
+ def stats_totals(self, year, level='B'):
+ return self.get_stats_table('totals', year, level=level)
+
+ @sportsref.decorators.memoize
+ def stats_per36(self, year, level='B'):
+ return self.get_stats_table('per_minute', year, level=level)
+
+ @sportsref.decorators.memoize
+ def stats_advanced(self, year, level='B'):
+ return self.get_stats_table('advanced', year, level=level)
+
diff --git a/sportsref/nba/boxscores.py b/sportsref/nba/boxscores.py
index d55495d..d5903d2 100644
--- a/sportsref/nba/boxscores.py
+++ b/sportsref/nba/boxscores.py
@@ -50,7 +50,7 @@ def date(self):
:returns: A datetime.date object with year, month, and day attributes.
"""
match = re.match(r'(\d{4})(\d{2})(\d{2})', self.boxscore_id)
- year, month, day = map(int, match.groups())
+ year, month, day = list(map(int, match.groups()))
return datetime.date(year=year, month=month, day=day)
@sportsref.decorators.memoize
@@ -71,8 +71,8 @@ def linescore(self):
columns[0] = 'team_id'
data = [
- [sportsref.utils.flatten_links(td) for td in tr('td').items()]
- for tr in table('tr.thead').next_all('tr').items()
+ [sportsref.utils.flatten_links(td) for td in list(tr('td').items())]
+ for tr in list(table('tr.thead').next_all('tr').items())
]
return pd.DataFrame(data, index=['away', 'home'],
@@ -194,7 +194,7 @@ def pbp(self, dense_lineups=False, sparse_lineups=False):
)
table = doc('table#pbp')
trs = [
- tr for tr in table('tr').items()
+ tr for tr in list(table('tr').items())
if (not tr.attr['class'] or # regular data rows
tr.attr['id'] and tr.attr['id'].startswith('q')) # qtr bounds
]
@@ -218,7 +218,7 @@ def pbp(self, dense_lineups=False, sparse_lineups=False):
# add time of play to entry
t_str = row.eq(0).text()
t_regex = r'(\d+):(\d+)\.(\d+)'
- mins, secs, tenths = map(int, re.match(t_regex, t_str).groups())
+ mins, secs, tenths = list(map(int, re.match(t_regex, t_str).groups()))
endQ = (12 * 60 * min(cur_qtr, 4) +
5 * 60 * (cur_qtr - 4 if cur_qtr > 4 else 0))
secsElapsed = endQ - (60 * mins + secs + 0.1 * tenths)
@@ -246,11 +246,11 @@ def pbp(self, dense_lineups=False, sparse_lineups=False):
# if another case, log and continue
else:
if not desc.text().lower().startswith('end of '):
- print(
+ print((
'{}, Q{}, {} other case: {}'
.format(self.boxscore_id, cur_qtr,
t_str, desc.text())
- )
+ ))
continue
# handle team play description
@@ -276,8 +276,8 @@ def pbp(self, dense_lineups=False, sparse_lineups=False):
p = orig_p
new_p = new_p[1]
elif new_p.get('is_error'):
- print("can't parse: {}, boxscore: {}"
- .format(desc, self.boxscore_id))
+ print(("can't parse: {}, boxscore: {}"
+ .format(desc, self.boxscore_id)))
# import pdb; pdb.set_trace()
p.update(new_p)
diff --git a/sportsref/nba/pbp.py b/sportsref/nba/pbp.py
index 867a981..9c95291 100644
--- a/sportsref/nba/pbp.py
+++ b/sportsref/nba/pbp.py
@@ -37,7 +37,7 @@ def parse_play(boxscore_id, details, is_hm):
:rtype: dictionary or None
"""
# if input isn't a string, return None
- if not details or not isinstance(details, basestring):
+ if not details or not isinstance(details, str):
return None
bs = sportsref.nba.BoxScore(boxscore_id)
@@ -498,8 +498,8 @@ def players_from_play(play):
break
if len(hm_starters) != 5 or len(aw_starters) != 5:
- print('WARNING: wrong number of starters for a team in Q{} of {}'
- .format(qtr, df.boxscore_id.iloc[0]))
+ print(('WARNING: wrong number of starters for a team in Q{} of {}'
+ .format(qtr, df.boxscore_id.iloc[0])))
return period_starters
@@ -588,9 +588,9 @@ def handle_sub(row, aw_lineup, hm_lineup):
):
return aw_lineup, hm_lineup
# otherwise, let's print and pretend this never happened
- print('ERROR IN SUB IN {}, Q{}, {}: {}'
+ print(('ERROR IN SUB IN {}, Q{}, {}: {}'
.format(row['boxscore_id'], row['quarter'],
- row['clock_time'], row['detail']))
+ row['clock_time'], row['detail'])))
raise
return aw_lineup, hm_lineup
@@ -611,7 +611,7 @@ def handle_sub(row, aw_lineup, hm_lineup):
lineups[i-1] = lineup_dict(aw_lineup, hm_lineup)
# then, move on to the quarter, and enter the starting lineups
cur_qtr += 1
- aw_lineup, hm_lineup = map(list, per_starters[cur_qtr-1])
+ aw_lineup, hm_lineup = list(map(list, per_starters[cur_qtr-1]))
lineups[i] = lineup_dict(aw_lineup, hm_lineup)
# if the first play in the quarter is a sub, handle that
if row['is_sub']:
diff --git a/sportsref/nba/players.py b/sportsref/nba/players.py
index a754e02..85dc834 100644
--- a/sportsref/nba/players.py
+++ b/sportsref/nba/players.py
@@ -24,6 +24,7 @@ class Player(future.utils.with_metaclass(sportsref.decorators.Cached, object)):
from the player's Basketball Reference player page."""
def __init__(self, player_id):
+ print('init called')
self.player_id = player_id
self.url_base = (sportsref.nba.BASE_URL +
'/players/{0[0]}/{0}').format(self.player_id)
@@ -43,6 +44,7 @@ def __str__(self):
@sportsref.decorators.memoize
def get_main_doc(self):
+ print('GET_MAIN_DOC called')
return pq(sportsref.utils.get_html(self.main_url))
@sportsref.decorators.memoize
@@ -68,7 +70,7 @@ def age(self, year, month=2, day=1):
doc = self.get_main_doc()
date_string = doc('span[itemprop="birthDate"]').attr('data-birth')
regex = r'(\d{4})\-(\d{2})\-(\d{2})'
- date_args = map(int, re.match(regex, date_string).groups())
+ date_args = list(map(int, re.match(regex, date_string).groups()))
birth_date = datetime.date(*date_args)
age_date = datetime.date(year=year, month=month, day=day)
delta = age_date - birth_date
@@ -90,7 +92,7 @@ def height(self):
doc = self.get_main_doc()
raw = doc('span[itemprop="height"]').text()
try:
- feet, inches = map(int, raw.split('-'))
+ feet, inches = list(map(int, raw.split('-')))
return feet * 12 + inches
except ValueError:
return None
@@ -149,9 +151,12 @@ def _get_stats_table(self, table_id, kind='R', summary=False):
:returns: A DataFrame of stats.
"""
doc = self.get_main_doc()
+ #print(doc)
table_id = 'table#{}{}'.format(
'playoffs_' if kind == 'P' else '', table_id)
+ #print(table_id)
table = doc(table_id)
+ #print(table)
df = sportsref.utils.parse_table(table, flatten=(not summary),
footer=summary)
return df
@@ -207,6 +212,7 @@ def gamelog_basic(self, year, kind='R'):
doc = self.get_sub_doc('gamelog/{}'.format(year))
table = (doc('table#pgl_basic_playoffs')
if kind == 'P' else doc('table#pgl_basic'))
+ print('STARTED PARSING')
df = sportsref.utils.parse_table(table)
return df
diff --git a/sportsref/nba/seasons.py b/sportsref/nba/seasons.py
index 25af437..98176ef 100644
--- a/sportsref/nba/seasons.py
+++ b/sportsref/nba/seasons.py
@@ -84,7 +84,7 @@ def team_ids_to_names(self):
team_names = unflattened['team_name']
if len(team_names) != len(team_ids):
raise Exception("team names and team IDs don't align")
- return dict(zip(team_ids, team_names))
+ return dict(list(zip(team_ids, team_names)))
@sportsref.decorators.memoize
def team_names_to_ids(self):
@@ -92,7 +92,7 @@ def team_names_to_ids(self):
:returns: Dictionary with tean names as keys and team IDs as values.
"""
d = self.team_ids_to_names()
- return {v: k for k, v in d.items()}
+ return {v: k for k, v in list(d.items())}
@sportsref.decorators.memoize
@sportsref.decorators.kind_rpb(include_type=True)
diff --git a/sportsref/nba/teams.py b/sportsref/nba/teams.py
index cadb37b..77db2f3 100644
--- a/sportsref/nba/teams.py
+++ b/sportsref/nba/teams.py
@@ -62,8 +62,8 @@ def roster(self, year):
.replace('R', 0).replace('', np.nan).astype(float))
return df
- # TODO: kind_rpb
@sportsref.decorators.memoize
+ @sportsref.decorators.kind_rpb(include_type=True)
def schedule(self, year):
"""Gets schedule information for a team-season.
diff --git a/sportsref/nfl/boxscores.py b/sportsref/nfl/boxscores.py
index 060d05b..8962599 100644
--- a/sportsref/nfl/boxscores.py
+++ b/sportsref/nfl/boxscores.py
@@ -54,7 +54,7 @@ def date(self):
:returns: A datetime.date object with year, month, and day attributes.
"""
match = re.match(r'(\d{4})(\d{2})(\d{2})', self.boxscore_id)
- year, month, day = map(int, match.groups())
+ year, month, day = list(map(int, match.groups()))
return datetime.date(year=year, month=month, day=day)
@sportsref.decorators.memoize
diff --git a/sportsref/nfl/players.py b/sportsref/nfl/players.py
index 3921caf..d6f6338 100644
--- a/sportsref/nfl/players.py
+++ b/sportsref/nfl/players.py
@@ -72,7 +72,7 @@ def age(self, year, month=9, day=1):
try:
dateargs = re.match(r'(\d{4})\-(\d{2})\-(\d{2})',
birthstring).groups()
- dateargs = map(int, dateargs)
+ dateargs = list(map(int, dateargs))
birthDate = datetime.date(*dateargs)
delta = datetime.date(year=year, month=month, day=day) - birthDate
age = delta.days / 365
@@ -97,7 +97,7 @@ def height(self):
doc = self.get_doc()
rawText = doc('div#meta p span[itemprop="height"]').text()
try:
- feet, inches = map(int, rawText.split('-'))
+ feet, inches = list(map(int, rawText.split('-')))
return feet * 12 + inches
except ValueError:
return None
diff --git a/sportsref/utils.py b/sportsref/utils.py
index 0e7df5b..20547c5 100644
--- a/sportsref/utils.py
+++ b/sportsref/utils.py
@@ -74,7 +74,14 @@ def parse_table(table, flatten=True, footer=False):
# get data
rows = list(table('tbody tr' if not footer else 'tfoot tr')
- .not_('.thead, .stat_total, .stat_average').items())
+ .not_('.thead, .stat_total, .stat_average').items())
+
+ # edge case for team and opp euro stats (not specifying it by id in case this approach works for other tables set up like this)
+ if len(columns) == 0:
+ columns = [c.attrib['data-stat'] for c in table('.thead th[data-stat]')]
+ columns[0] = 'team'
+ rows = list(table('tr').not_('.thead').items())
+
data = [
[flatten_links(td) if flatten else td.text()
for td in row.items('th,td')]
@@ -322,6 +329,7 @@ def rel_url_to_id(url):
url.startswith(s) for s in
(
'/play-index/',
+ '/euro/'
)
):
return url
diff --git a/test_notebooks/euro/euro_boxscore_test.ipynb b/test_notebooks/euro/euro_boxscore_test.ipynb
new file mode 100644
index 0000000..825af71
--- /dev/null
+++ b/test_notebooks/euro/euro_boxscore_test.ipynb
@@ -0,0 +1,447 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# euro.BoxScore test"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "from sportsref import euro"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": [
+ "box = euro.BoxScore('2018-02-04-bilbao')"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Non dataframe methods - not many visible changes, but differences in how to access them with pyquery in code"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2018-02-04\n",
+ "Sunday\n",
+ "bilbao\n",
+ "77\n",
+ "fuenlabrada\n",
+ "83\n",
+ "fuenlabrada\n",
+ "2018\n"
+ ]
+ }
+ ],
+ "source": [
+ "print(box.date())\n",
+ "print(box.weekday())\n",
+ "print(box.home())\n",
+ "print(box.home_score())\n",
+ "print(box.away())\n",
+ "print(box.away_score())\n",
+ "print(box.winner())\n",
+ "print(box.season())\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Stats tables - very few changes"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "
\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " player_id | \n",
+ " mp | \n",
+ " fg | \n",
+ " fga | \n",
+ " fg3 | \n",
+ " fg3a | \n",
+ " ft | \n",
+ " fta | \n",
+ " orb | \n",
+ " trb | \n",
+ " ast | \n",
+ " stl | \n",
+ " blk | \n",
+ " tov | \n",
+ " pf | \n",
+ " pts | \n",
+ " player_name | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " | 0 | \n",
+ " devin-thomas-1 | \n",
+ " 30.0 | \n",
+ " 6.0 | \n",
+ " 9.0 | \n",
+ " 0.0 | \n",
+ " 0.0 | \n",
+ " 2.0 | \n",
+ " 6.0 | \n",
+ " 2.0 | \n",
+ " 4.0 | \n",
+ " 2.0 | \n",
+ " 4.0 | \n",
+ " 3.0 | \n",
+ " 0.0 | \n",
+ " 4.0 | \n",
+ " 14.0 | \n",
+ " Thomas, Devin | \n",
+ "
\n",
+ " \n",
+ " | 1 | \n",
+ " shane-hammink-1 | \n",
+ " 28.0 | \n",
+ " 4.0 | \n",
+ " 5.0 | \n",
+ " 0.0 | \n",
+ " 0.0 | \n",
+ " 4.0 | \n",
+ " 4.0 | \n",
+ " 0.0 | \n",
+ " 3.0 | \n",
+ " 2.0 | \n",
+ " 1.0 | \n",
+ " 0.0 | \n",
+ " 0.0 | \n",
+ " 2.0 | \n",
+ " 12.0 | \n",
+ " Hammink, Shane | \n",
+ "
\n",
+ " \n",
+ " | 2 | \n",
+ " jonathan-tabu-1 | \n",
+ " 26.0 | \n",
+ " 2.0 | \n",
+ " 7.0 | \n",
+ " 1.0 | \n",
+ " 4.0 | \n",
+ " 7.0 | \n",
+ " 8.0 | \n",
+ " 0.0 | \n",
+ " 3.0 | \n",
+ " 0.0 | \n",
+ " 1.0 | \n",
+ " 0.0 | \n",
+ " 2.0 | \n",
+ " 4.0 | \n",
+ " 12.0 | \n",
+ " Tabu, Jonathan | \n",
+ "
\n",
+ " \n",
+ " | 3 | \n",
+ " alex-mumbru-1 | \n",
+ " 25.0 | \n",
+ " 5.0 | \n",
+ " 8.0 | \n",
+ " 2.0 | \n",
+ " 5.0 | \n",
+ " 7.0 | \n",
+ " 8.0 | \n",
+ " 0.0 | \n",
+ " 2.0 | \n",
+ " 4.0 | \n",
+ " 1.0 | \n",
+ " 1.0 | \n",
+ " 0.0 | \n",
+ " 3.0 | \n",
+ " 19.0 | \n",
+ " Mumbrú, Álex | \n",
+ "
\n",
+ " \n",
+ " | 4 | \n",
+ " axel-hervelle-1 | \n",
+ " 19.0 | \n",
+ " 0.0 | \n",
+ " 2.0 | \n",
+ " 0.0 | \n",
+ " 0.0 | \n",
+ " 4.0 | \n",
+ " 4.0 | \n",
+ " 2.0 | \n",
+ " 4.0 | \n",
+ " 3.0 | \n",
+ " 0.0 | \n",
+ " 0.0 | \n",
+ " 1.0 | \n",
+ " 3.0 | \n",
+ " 4.0 | \n",
+ " Hervelle, Axel | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ " player_id mp fg fga fg3 fg3a ft fta orb trb ast stl \\\n",
+ "0 devin-thomas-1 30.0 6.0 9.0 0.0 0.0 2.0 6.0 2.0 4.0 2.0 4.0 \n",
+ "1 shane-hammink-1 28.0 4.0 5.0 0.0 0.0 4.0 4.0 0.0 3.0 2.0 1.0 \n",
+ "2 jonathan-tabu-1 26.0 2.0 7.0 1.0 4.0 7.0 8.0 0.0 3.0 0.0 1.0 \n",
+ "3 alex-mumbru-1 25.0 5.0 8.0 2.0 5.0 7.0 8.0 0.0 2.0 4.0 1.0 \n",
+ "4 axel-hervelle-1 19.0 0.0 2.0 0.0 0.0 4.0 4.0 2.0 4.0 3.0 0.0 \n",
+ "\n",
+ " blk tov pf pts player_name \n",
+ "0 3.0 0.0 4.0 14.0 Thomas, Devin \n",
+ "1 0.0 0.0 2.0 12.0 Hammink, Shane \n",
+ "2 0.0 2.0 4.0 12.0 Tabu, Jonathan \n",
+ "3 1.0 0.0 3.0 19.0 Mumbrú, Álex \n",
+ "4 0.0 1.0 3.0 4.0 Hervelle, Axel "
+ ]
+ },
+ "execution_count": 7,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "box.get_home_stats().head()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " player_id | \n",
+ " mp | \n",
+ " fg | \n",
+ " fga | \n",
+ " fg3 | \n",
+ " fg3a | \n",
+ " ft | \n",
+ " fta | \n",
+ " orb | \n",
+ " trb | \n",
+ " ast | \n",
+ " stl | \n",
+ " blk | \n",
+ " tov | \n",
+ " pf | \n",
+ " pts | \n",
+ " player_name | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " | 0 | \n",
+ " christian-eyenga-1 | \n",
+ " 35.0 | \n",
+ " 4.0 | \n",
+ " 8.0 | \n",
+ " 2.0 | \n",
+ " 4.0 | \n",
+ " 0.0 | \n",
+ " 0.0 | \n",
+ " 1.0 | \n",
+ " 3.0 | \n",
+ " 0.0 | \n",
+ " 1.0 | \n",
+ " 1.0 | \n",
+ " 1.0 | \n",
+ " 2.0 | \n",
+ " 10.0 | \n",
+ " Eyenga, C. | \n",
+ "
\n",
+ " \n",
+ " | 1 | \n",
+ " rolands-smits-1 | \n",
+ " 27.0 | \n",
+ " 3.0 | \n",
+ " 5.0 | \n",
+ " 2.0 | \n",
+ " 4.0 | \n",
+ " 3.0 | \n",
+ " 4.0 | \n",
+ " 2.0 | \n",
+ " 4.0 | \n",
+ " 0.0 | \n",
+ " 0.0 | \n",
+ " 0.0 | \n",
+ " 2.0 | \n",
+ " 5.0 | \n",
+ " 11.0 | \n",
+ " Smits, Rolands | \n",
+ "
\n",
+ " \n",
+ " | 2 | \n",
+ " marko-popovic-1 | \n",
+ " 26.0 | \n",
+ " 8.0 | \n",
+ " 13.0 | \n",
+ " 4.0 | \n",
+ " 9.0 | \n",
+ " 5.0 | \n",
+ " 8.0 | \n",
+ " 0.0 | \n",
+ " 2.0 | \n",
+ " 4.0 | \n",
+ " 1.0 | \n",
+ " 0.0 | \n",
+ " 2.0 | \n",
+ " 2.0 | \n",
+ " 25.0 | \n",
+ " Popovic, Marko | \n",
+ "
\n",
+ " \n",
+ " | 3 | \n",
+ " blagota-sekulic-1 | \n",
+ " 24.0 | \n",
+ " 2.0 | \n",
+ " 4.0 | \n",
+ " 1.0 | \n",
+ " 2.0 | \n",
+ " 6.0 | \n",
+ " 6.0 | \n",
+ " 1.0 | \n",
+ " 2.0 | \n",
+ " 1.0 | \n",
+ " 0.0 | \n",
+ " 0.0 | \n",
+ " 4.0 | \n",
+ " 2.0 | \n",
+ " 11.0 | \n",
+ " Sekulic, Blagota | \n",
+ "
\n",
+ " \n",
+ " | 4 | \n",
+ " francisco-cruz-1 | \n",
+ " 24.0 | \n",
+ " 4.0 | \n",
+ " 8.0 | \n",
+ " 1.0 | \n",
+ " 4.0 | \n",
+ " 1.0 | \n",
+ " 2.0 | \n",
+ " 0.0 | \n",
+ " 2.0 | \n",
+ " 4.0 | \n",
+ " 2.0 | \n",
+ " 0.0 | \n",
+ " 1.0 | \n",
+ " 1.0 | \n",
+ " 10.0 | \n",
+ " Cruz, Francisco | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ " player_id mp fg fga fg3 fg3a ft fta orb trb ast \\\n",
+ "0 christian-eyenga-1 35.0 4.0 8.0 2.0 4.0 0.0 0.0 1.0 3.0 0.0 \n",
+ "1 rolands-smits-1 27.0 3.0 5.0 2.0 4.0 3.0 4.0 2.0 4.0 0.0 \n",
+ "2 marko-popovic-1 26.0 8.0 13.0 4.0 9.0 5.0 8.0 0.0 2.0 4.0 \n",
+ "3 blagota-sekulic-1 24.0 2.0 4.0 1.0 2.0 6.0 6.0 1.0 2.0 1.0 \n",
+ "4 francisco-cruz-1 24.0 4.0 8.0 1.0 4.0 1.0 2.0 0.0 2.0 4.0 \n",
+ "\n",
+ " stl blk tov pf pts player_name \n",
+ "0 1.0 1.0 1.0 2.0 10.0 Eyenga, C. \n",
+ "1 0.0 0.0 2.0 5.0 11.0 Smits, Rolands \n",
+ "2 1.0 0.0 2.0 2.0 25.0 Popovic, Marko \n",
+ "3 0.0 0.0 4.0 2.0 11.0 Sekulic, Blagota \n",
+ "4 2.0 0.0 1.0 1.0 10.0 Cruz, Francisco "
+ ]
+ },
+ "execution_count": 8,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "box.get_away_stats().head()"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 3",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.6.3"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}
diff --git a/test_notebooks/euro/euro_player_test.ipynb b/test_notebooks/euro/euro_player_test.ipynb
new file mode 100644
index 0000000..bee655c
--- /dev/null
+++ b/test_notebooks/euro/euro_player_test.ipynb
@@ -0,0 +1,3740 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# euro.Player test"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 28,
+ "metadata": {
+ "scrolled": true
+ },
+ "outputs": [],
+ "source": [
+ "from sportsref import euro"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 31,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": [
+ "player = euro.Player('victor-claver-1')"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## simple methods: Almost no changes"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 32,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Victor Claver\n",
+ "28.443835616438356\n",
+ "81\n",
+ "224\n"
+ ]
+ }
+ ],
+ "source": [
+ "print(player.name())\n",
+ "print(player.age(2017))\n",
+ "print(player.height())\n",
+ "print(player.weight())"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Added position and nba_id\n",
+ "### If player also played in NBA, returns their bballref id, if not, returns None"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 33,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "SForward\n",
+ "clavevi01\n"
+ ]
+ }
+ ],
+ "source": [
+ "print(player.position())\n",
+ "print(player.nba_id())"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Gamelogs - different url style"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "[(2016, 'ELG'), (2017, 'ELG'), (2017, 'SPA'), (2018, 'ELG'), (2018, 'SPA')]\n"
+ ]
+ }
+ ],
+ "source": [
+ "# new method: to me, would be useful/necessary\n",
+ "# because gamelogs are split by league and year\n",
+ "\n",
+ "print(player.available_gamelogs())"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 35,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " boxscore_id | \n",
+ " age | \n",
+ " team_id | \n",
+ " is_home | \n",
+ " opp_id | \n",
+ " game_result | \n",
+ " mp | \n",
+ " fg | \n",
+ " fga | \n",
+ " fg_pct | \n",
+ " ... | \n",
+ " orb | \n",
+ " drb | \n",
+ " trb | \n",
+ " ast | \n",
+ " stl | \n",
+ " blk | \n",
+ " tov | \n",
+ " pf | \n",
+ " pts | \n",
+ " game_score | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " | 0 | \n",
+ " 2016-10-02-manresa | \n",
+ " 28-033 | \n",
+ " Barcelona | \n",
+ " False | \n",
+ " Manresa | \n",
+ " W | \n",
+ " 17.850000 | \n",
+ " 0.0 | \n",
+ " 4.0 | \n",
+ " 0.000 | \n",
+ " ... | \n",
+ " 0.0 | \n",
+ " 3.0 | \n",
+ " 3.0 | \n",
+ " 0.0 | \n",
+ " 2.0 | \n",
+ " 2.0 | \n",
+ " 3.0 | \n",
+ " 1.0 | \n",
+ " 0.0 | \n",
+ " -1.9 | \n",
+ "
\n",
+ " \n",
+ " | 1 | \n",
+ " 2016-10-09-barcelona | \n",
+ " 28-040 | \n",
+ " Barcelona | \n",
+ " True | \n",
+ " Vitoria | \n",
+ " W | \n",
+ " 24.483333 | \n",
+ " 1.0 | \n",
+ " 4.0 | \n",
+ " 0.250 | \n",
+ " ... | \n",
+ " 1.0 | \n",
+ " 5.0 | \n",
+ " 6.0 | \n",
+ " 2.0 | \n",
+ " 0.0 | \n",
+ " 1.0 | \n",
+ " 2.0 | \n",
+ " 1.0 | \n",
+ " 2.0 | \n",
+ " 1.5 | \n",
+ "
\n",
+ " \n",
+ " | 2 | \n",
+ " 2016-10-16-bilbao | \n",
+ " 28-047 | \n",
+ " Barcelona | \n",
+ " False | \n",
+ " Bilbao | \n",
+ " L | \n",
+ " 18.466667 | \n",
+ " 0.0 | \n",
+ " 2.0 | \n",
+ " 0.000 | \n",
+ " ... | \n",
+ " 0.0 | \n",
+ " 0.0 | \n",
+ " 0.0 | \n",
+ " 2.0 | \n",
+ " 0.0 | \n",
+ " 0.0 | \n",
+ " 2.0 | \n",
+ " 5.0 | \n",
+ " 1.0 | \n",
+ " -3.4 | \n",
+ "
\n",
+ " \n",
+ " | 3 | \n",
+ " 2016-10-23-barcelona | \n",
+ " 28-054 | \n",
+ " Barcelona | \n",
+ " True | \n",
+ " Sevilla | \n",
+ " W | \n",
+ " 19.316667 | \n",
+ " 1.0 | \n",
+ " 3.0 | \n",
+ " 0.333 | \n",
+ " ... | \n",
+ " 0.0 | \n",
+ " 2.0 | \n",
+ " 2.0 | \n",
+ " 2.0 | \n",
+ " 1.0 | \n",
+ " 0.0 | \n",
+ " 2.0 | \n",
+ " 1.0 | \n",
+ " 2.0 | \n",
+ " 0.9 | \n",
+ "
\n",
+ " \n",
+ " | 4 | \n",
+ " 2016-10-30-fuenlabrada | \n",
+ " 28-061 | \n",
+ " Barcelona | \n",
+ " False | \n",
+ " Fuenlabrada | \n",
+ " W | \n",
+ " 10.250000 | \n",
+ " 0.0 | \n",
+ " 2.0 | \n",
+ " 0.000 | \n",
+ " ... | \n",
+ " 0.0 | \n",
+ " 1.0 | \n",
+ " 1.0 | \n",
+ " 0.0 | \n",
+ " 1.0 | \n",
+ " 0.0 | \n",
+ " 1.0 | \n",
+ " 2.0 | \n",
+ " 0.0 | \n",
+ " -1.9 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
5 rows × 26 columns
\n",
+ "
"
+ ],
+ "text/plain": [
+ " boxscore_id age team_id is_home opp_id \\\n",
+ "0 2016-10-02-manresa 28-033 Barcelona False Manresa \n",
+ "1 2016-10-09-barcelona 28-040 Barcelona True Vitoria \n",
+ "2 2016-10-16-bilbao 28-047 Barcelona False Bilbao \n",
+ "3 2016-10-23-barcelona 28-054 Barcelona True Sevilla \n",
+ "4 2016-10-30-fuenlabrada 28-061 Barcelona False Fuenlabrada \n",
+ "\n",
+ " game_result mp fg fga fg_pct ... orb drb trb ast \\\n",
+ "0 W 17.850000 0.0 4.0 0.000 ... 0.0 3.0 3.0 0.0 \n",
+ "1 W 24.483333 1.0 4.0 0.250 ... 1.0 5.0 6.0 2.0 \n",
+ "2 L 18.466667 0.0 2.0 0.000 ... 0.0 0.0 0.0 2.0 \n",
+ "3 W 19.316667 1.0 3.0 0.333 ... 0.0 2.0 2.0 2.0 \n",
+ "4 W 10.250000 0.0 2.0 0.000 ... 0.0 1.0 1.0 0.0 \n",
+ "\n",
+ " stl blk tov pf pts game_score \n",
+ "0 2.0 2.0 3.0 1.0 0.0 -1.9 \n",
+ "1 0.0 1.0 2.0 1.0 2.0 1.5 \n",
+ "2 0.0 0.0 2.0 5.0 1.0 -3.4 \n",
+ "3 1.0 0.0 2.0 1.0 2.0 0.9 \n",
+ "4 1.0 0.0 1.0 2.0 0.0 -1.9 \n",
+ "\n",
+ "[5 rows x 26 columns]"
+ ]
+ },
+ "execution_count": 35,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "player.gamelog_basic(2017, 'SPA').head()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " boxscore_id | \n",
+ " age | \n",
+ " team_id | \n",
+ " is_home | \n",
+ " opp_id | \n",
+ " game_result | \n",
+ " mp | \n",
+ " fg | \n",
+ " fga | \n",
+ " fg_pct | \n",
+ " ... | \n",
+ " orb | \n",
+ " drb | \n",
+ " trb | \n",
+ " ast | \n",
+ " stl | \n",
+ " blk | \n",
+ " tov | \n",
+ " pf | \n",
+ " pts | \n",
+ " game_score | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " | 0 | \n",
+ " 2017-11-03-barcelona | \n",
+ " 29-065 | \n",
+ " Barcelona | \n",
+ " True | \n",
+ " Olympiakos | \n",
+ " W | \n",
+ " 11.500000 | \n",
+ " 0.0 | \n",
+ " 2.0 | \n",
+ " 0.000 | \n",
+ " ... | \n",
+ " 0.0 | \n",
+ " 2.0 | \n",
+ " 2.0 | \n",
+ " 1.0 | \n",
+ " 2.0 | \n",
+ " 1.0 | \n",
+ " 0.0 | \n",
+ " 3.0 | \n",
+ " 0.0 | \n",
+ " 1.4 | \n",
+ "
\n",
+ " \n",
+ " | 1 | \n",
+ " 2017-11-09-barcelona | \n",
+ " 29-071 | \n",
+ " Barcelona | \n",
+ " True | \n",
+ " Anadolu-Efes | \n",
+ " L | \n",
+ " 15.216667 | \n",
+ " 5.0 | \n",
+ " 7.0 | \n",
+ " 0.714 | \n",
+ " ... | \n",
+ " 2.0 | \n",
+ " 0.0 | \n",
+ " 2.0 | \n",
+ " 1.0 | \n",
+ " 3.0 | \n",
+ " 0.0 | \n",
+ " 0.0 | \n",
+ " 1.0 | \n",
+ " 12.0 | \n",
+ " 13.8 | \n",
+ "
\n",
+ " \n",
+ " | 2 | \n",
+ " 2017-11-15-brose-baskets | \n",
+ " 29-077 | \n",
+ " Barcelona | \n",
+ " False | \n",
+ " Brose-Baskets | \n",
+ " L | \n",
+ " 15.816667 | \n",
+ " 1.0 | \n",
+ " 3.0 | \n",
+ " 0.333 | \n",
+ " ... | \n",
+ " 0.0 | \n",
+ " 4.0 | \n",
+ " 4.0 | \n",
+ " 1.0 | \n",
+ " 0.0 | \n",
+ " 0.0 | \n",
+ " 2.0 | \n",
+ " 1.0 | \n",
+ " 3.0 | \n",
+ " 0.8 | \n",
+ "
\n",
+ " \n",
+ " | 3 | \n",
+ " 2017-11-23-barcelona | \n",
+ " 29-085 | \n",
+ " Barcelona | \n",
+ " True | \n",
+ " Maccabi-Tel-Aviv | \n",
+ " W | \n",
+ " 17.333333 | \n",
+ " 1.0 | \n",
+ " 3.0 | \n",
+ " 0.333 | \n",
+ " ... | \n",
+ " 1.0 | \n",
+ " 2.0 | \n",
+ " 3.0 | \n",
+ " 2.0 | \n",
+ " 0.0 | \n",
+ " 0.0 | \n",
+ " 0.0 | \n",
+ " 4.0 | \n",
+ " 3.0 | \n",
+ " 2.4 | \n",
+ "
\n",
+ " \n",
+ " | 4 | \n",
+ " 2017-12-01-cska-moscow | \n",
+ " 29-093 | \n",
+ " Barcelona | \n",
+ " False | \n",
+ " Cska-Moscow | \n",
+ " L | \n",
+ " 6.583333 | \n",
+ " 0.0 | \n",
+ " 0.0 | \n",
+ " NaN | \n",
+ " ... | \n",
+ " 0.0 | \n",
+ " 1.0 | \n",
+ " 1.0 | \n",
+ " 0.0 | \n",
+ " 0.0 | \n",
+ " 0.0 | \n",
+ " 1.0 | \n",
+ " 1.0 | \n",
+ " 0.0 | \n",
+ " -1.1 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
5 rows × 26 columns
\n",
+ "
"
+ ],
+ "text/plain": [
+ " boxscore_id age team_id is_home opp_id \\\n",
+ "0 2017-11-03-barcelona 29-065 Barcelona True Olympiakos \n",
+ "1 2017-11-09-barcelona 29-071 Barcelona True Anadolu-Efes \n",
+ "2 2017-11-15-brose-baskets 29-077 Barcelona False Brose-Baskets \n",
+ "3 2017-11-23-barcelona 29-085 Barcelona True Maccabi-Tel-Aviv \n",
+ "4 2017-12-01-cska-moscow 29-093 Barcelona False Cska-Moscow \n",
+ "\n",
+ " game_result mp fg fga fg_pct ... orb drb trb ast \\\n",
+ "0 W 11.500000 0.0 2.0 0.000 ... 0.0 2.0 2.0 1.0 \n",
+ "1 L 15.216667 5.0 7.0 0.714 ... 2.0 0.0 2.0 1.0 \n",
+ "2 L 15.816667 1.0 3.0 0.333 ... 0.0 4.0 4.0 1.0 \n",
+ "3 W 17.333333 1.0 3.0 0.333 ... 1.0 2.0 3.0 2.0 \n",
+ "4 L 6.583333 0.0 0.0 NaN ... 0.0 1.0 1.0 0.0 \n",
+ "\n",
+ " stl blk tov pf pts game_score \n",
+ "0 2.0 1.0 0.0 3.0 0.0 1.4 \n",
+ "1 3.0 0.0 0.0 1.0 12.0 13.8 \n",
+ "2 0.0 0.0 2.0 1.0 3.0 0.8 \n",
+ "3 0.0 0.0 0.0 4.0 3.0 2.4 \n",
+ "4 0.0 0.0 1.0 1.0 0.0 -1.1 \n",
+ "\n",
+ "[5 rows x 26 columns]"
+ ]
+ },
+ "execution_count": 6,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "player.gamelog_basic(2018, 'ELG').head()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## stat_tables:\n",
+ "\n",
+ "\n",
+ "### took out stats_per100, stats_advanced, stats_shooting, stats_pbp (data not on bballref)\n",
+ "\n",
+ "### changed table_ids\n",
+ "\n",
+ "### parameters:\n",
+ "\n",
+ "### Kind (works the same)\n",
+ "\n",
+ "### Level (needed, because different docs are pulled from)\n",
+ "\n",
+ "#### -B (pulls from main milos-teodosic doc - default)\n",
+ "#### -C (pulls from milos-teodosic-club)\n",
+ "#### -E (pulls from milos-teodosic-tournament, which is Eurocup/Euroleague play)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Test: level='B' - Both"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 38,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "9\n"
+ ]
+ }
+ ],
+ "source": [
+ "df = player.stats_per_game(kind='R', level='B')\n",
+ "\n",
+ "print(len(df))"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 37,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " season | \n",
+ " lg_name | \n",
+ " g | \n",
+ " gs | \n",
+ " mp_per_g | \n",
+ " fg_per_g | \n",
+ " fga_per_g | \n",
+ " fg_pct | \n",
+ " fg3_per_g | \n",
+ " fg3a_per_g | \n",
+ " ... | \n",
+ " orb_per_g | \n",
+ " drb_per_g | \n",
+ " trb_per_g | \n",
+ " ast_per_g | \n",
+ " stl_per_g | \n",
+ " blk_per_g | \n",
+ " tov_per_g | \n",
+ " pf_per_g | \n",
+ " pts_per_g | \n",
+ " is_playoffs | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " | 0 | \n",
+ " 2007 | \n",
+ " Liga ACB | \n",
+ " 19.0 | \n",
+ " NaN | \n",
+ " 6.6 | \n",
+ " 0.9 | \n",
+ " 2.2 | \n",
+ " 0.405 | \n",
+ " 0.2 | \n",
+ " 0.7 | \n",
+ " ... | \n",
+ " 0.4 | \n",
+ " 0.6 | \n",
+ " 0.9 | \n",
+ " 0.4 | \n",
+ " 0.4 | \n",
+ " 0.2 | \n",
+ " 0.6 | \n",
+ " 0.5 | \n",
+ " 2.3 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 1 | \n",
+ " 2008 | \n",
+ " ULEB Cup, Liga ACB | \n",
+ " 48.0 | \n",
+ " NaN | \n",
+ " 17.7 | \n",
+ " 2.2 | \n",
+ " 4.6 | \n",
+ " 0.480 | \n",
+ " 0.7 | \n",
+ " 2.0 | \n",
+ " ... | \n",
+ " 0.8 | \n",
+ " 2.2 | \n",
+ " 2.9 | \n",
+ " 0.9 | \n",
+ " 0.7 | \n",
+ " 0.4 | \n",
+ " 1.3 | \n",
+ " 1.8 | \n",
+ " 5.9 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 2 | \n",
+ " 2009 | \n",
+ " Liga ACB, EuroCup | \n",
+ " 20.0 | \n",
+ " NaN | \n",
+ " 21.3 | \n",
+ " 2.5 | \n",
+ " 4.8 | \n",
+ " 0.521 | \n",
+ " 0.9 | \n",
+ " 2.2 | \n",
+ " ... | \n",
+ " 0.7 | \n",
+ " 3.4 | \n",
+ " 4.1 | \n",
+ " 0.8 | \n",
+ " 0.9 | \n",
+ " 0.6 | \n",
+ " 1.2 | \n",
+ " 2.0 | \n",
+ " 7.1 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 3 | \n",
+ " 2010 | \n",
+ " Liga ACB, EuroCup | \n",
+ " 50.0 | \n",
+ " NaN | \n",
+ " 25.6 | \n",
+ " 3.0 | \n",
+ " 6.8 | \n",
+ " 0.442 | \n",
+ " 0.9 | \n",
+ " 2.9 | \n",
+ " ... | \n",
+ " 1.0 | \n",
+ " 3.9 | \n",
+ " 4.9 | \n",
+ " 1.6 | \n",
+ " 1.0 | \n",
+ " 0.4 | \n",
+ " 1.8 | \n",
+ " 2.3 | \n",
+ " 8.2 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 4 | \n",
+ " 2011 | \n",
+ " EuroLeague, Liga ACB | \n",
+ " 38.0 | \n",
+ " NaN | \n",
+ " 28.4 | \n",
+ " 3.8 | \n",
+ " 8.2 | \n",
+ " 0.465 | \n",
+ " 1.3 | \n",
+ " 3.3 | \n",
+ " ... | \n",
+ " 1.1 | \n",
+ " 3.6 | \n",
+ " 4.7 | \n",
+ " 1.8 | \n",
+ " 1.4 | \n",
+ " 0.6 | \n",
+ " 2.2 | \n",
+ " 2.2 | \n",
+ " 11.3 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
5 rows × 27 columns
\n",
+ "
"
+ ],
+ "text/plain": [
+ " season lg_name g gs mp_per_g fg_per_g fga_per_g \\\n",
+ "0 2007 Liga ACB 19.0 NaN 6.6 0.9 2.2 \n",
+ "1 2008 ULEB Cup, Liga ACB 48.0 NaN 17.7 2.2 4.6 \n",
+ "2 2009 Liga ACB, EuroCup 20.0 NaN 21.3 2.5 4.8 \n",
+ "3 2010 Liga ACB, EuroCup 50.0 NaN 25.6 3.0 6.8 \n",
+ "4 2011 EuroLeague, Liga ACB 38.0 NaN 28.4 3.8 8.2 \n",
+ "\n",
+ " fg_pct fg3_per_g fg3a_per_g ... orb_per_g drb_per_g \\\n",
+ "0 0.405 0.2 0.7 ... 0.4 0.6 \n",
+ "1 0.480 0.7 2.0 ... 0.8 2.2 \n",
+ "2 0.521 0.9 2.2 ... 0.7 3.4 \n",
+ "3 0.442 0.9 2.9 ... 1.0 3.9 \n",
+ "4 0.465 1.3 3.3 ... 1.1 3.6 \n",
+ "\n",
+ " trb_per_g ast_per_g stl_per_g blk_per_g tov_per_g pf_per_g pts_per_g \\\n",
+ "0 0.9 0.4 0.4 0.2 0.6 0.5 2.3 \n",
+ "1 2.9 0.9 0.7 0.4 1.3 1.8 5.9 \n",
+ "2 4.1 0.8 0.9 0.6 1.2 2.0 7.1 \n",
+ "3 4.9 1.6 1.0 0.4 1.8 2.3 8.2 \n",
+ "4 4.7 1.8 1.4 0.6 2.2 2.2 11.3 \n",
+ "\n",
+ " is_playoffs \n",
+ "0 False \n",
+ "1 False \n",
+ "2 False \n",
+ "3 False \n",
+ "4 False \n",
+ "\n",
+ "[5 rows x 27 columns]"
+ ]
+ },
+ "execution_count": 37,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "df.head()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 39,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "7\n"
+ ]
+ }
+ ],
+ "source": [
+ "df = player.stats_per_game(kind='P', level='B')\n",
+ "\n",
+ "print(len(df))"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 40,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " season | \n",
+ " lg_name | \n",
+ " g | \n",
+ " gs | \n",
+ " mp_per_g | \n",
+ " fg_per_g | \n",
+ " fga_per_g | \n",
+ " fg_pct | \n",
+ " fg3_per_g | \n",
+ " fg3a_per_g | \n",
+ " ... | \n",
+ " orb_per_g | \n",
+ " drb_per_g | \n",
+ " trb_per_g | \n",
+ " ast_per_g | \n",
+ " stl_per_g | \n",
+ " blk_per_g | \n",
+ " tov_per_g | \n",
+ " pf_per_g | \n",
+ " pts_per_g | \n",
+ " is_playoffs | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " | 0 | \n",
+ " 2007 | \n",
+ " Liga ACB | \n",
+ " 4.0 | \n",
+ " NaN | \n",
+ " 20.8 | \n",
+ " 4.0 | \n",
+ " 8.0 | \n",
+ " 0.500 | \n",
+ " 1.0 | \n",
+ " 3.3 | \n",
+ " ... | \n",
+ " 0.8 | \n",
+ " 1.3 | \n",
+ " 2.0 | \n",
+ " 0.8 | \n",
+ " 0.3 | \n",
+ " 0.8 | \n",
+ " 1.0 | \n",
+ " 0.8 | \n",
+ " 11.5 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | 1 | \n",
+ " 2008 | \n",
+ " Liga ACB | \n",
+ " 3.0 | \n",
+ " NaN | \n",
+ " 12.3 | \n",
+ " 0.7 | \n",
+ " 2.0 | \n",
+ " 0.333 | \n",
+ " 0.0 | \n",
+ " 0.7 | \n",
+ " ... | \n",
+ " 0.7 | \n",
+ " 1.7 | \n",
+ " 2.3 | \n",
+ " 0.7 | \n",
+ " 0.3 | \n",
+ " 0.0 | \n",
+ " 0.7 | \n",
+ " 1.0 | \n",
+ " 2.7 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | 2 | \n",
+ " 2009 | \n",
+ " Liga ACB | \n",
+ " 2.0 | \n",
+ " NaN | \n",
+ " 25.0 | \n",
+ " 0.5 | \n",
+ " 5.0 | \n",
+ " 0.100 | \n",
+ " 0.0 | \n",
+ " 2.0 | \n",
+ " ... | \n",
+ " 1.0 | \n",
+ " 3.5 | \n",
+ " 4.5 | \n",
+ " 0.5 | \n",
+ " 1.5 | \n",
+ " 0.0 | \n",
+ " 2.0 | \n",
+ " 2.0 | \n",
+ " 2.5 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | 3 | \n",
+ " 2010 | \n",
+ " Liga ACB | \n",
+ " 2.0 | \n",
+ " NaN | \n",
+ " 23.5 | \n",
+ " 3.0 | \n",
+ " 7.0 | \n",
+ " 0.429 | \n",
+ " 1.0 | \n",
+ " 3.0 | \n",
+ " ... | \n",
+ " 0.5 | \n",
+ " 2.0 | \n",
+ " 2.5 | \n",
+ " 1.0 | \n",
+ " 0.5 | \n",
+ " 0.5 | \n",
+ " 1.5 | \n",
+ " 1.5 | \n",
+ " 8.0 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | 4 | \n",
+ " 2011 | \n",
+ " Liga ACB | \n",
+ " 2.0 | \n",
+ " NaN | \n",
+ " 27.0 | \n",
+ " 2.0 | \n",
+ " 6.5 | \n",
+ " 0.308 | \n",
+ " 0.5 | \n",
+ " 2.5 | \n",
+ " ... | \n",
+ " 0.5 | \n",
+ " 2.5 | \n",
+ " 3.0 | \n",
+ " 1.0 | \n",
+ " 1.0 | \n",
+ " 0.0 | \n",
+ " 3.0 | \n",
+ " 3.5 | \n",
+ " 6.0 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
5 rows × 27 columns
\n",
+ "
"
+ ],
+ "text/plain": [
+ " season lg_name g gs mp_per_g fg_per_g fga_per_g fg_pct \\\n",
+ "0 2007 Liga ACB 4.0 NaN 20.8 4.0 8.0 0.500 \n",
+ "1 2008 Liga ACB 3.0 NaN 12.3 0.7 2.0 0.333 \n",
+ "2 2009 Liga ACB 2.0 NaN 25.0 0.5 5.0 0.100 \n",
+ "3 2010 Liga ACB 2.0 NaN 23.5 3.0 7.0 0.429 \n",
+ "4 2011 Liga ACB 2.0 NaN 27.0 2.0 6.5 0.308 \n",
+ "\n",
+ " fg3_per_g fg3a_per_g ... orb_per_g drb_per_g trb_per_g \\\n",
+ "0 1.0 3.3 ... 0.8 1.3 2.0 \n",
+ "1 0.0 0.7 ... 0.7 1.7 2.3 \n",
+ "2 0.0 2.0 ... 1.0 3.5 4.5 \n",
+ "3 1.0 3.0 ... 0.5 2.0 2.5 \n",
+ "4 0.5 2.5 ... 0.5 2.5 3.0 \n",
+ "\n",
+ " ast_per_g stl_per_g blk_per_g tov_per_g pf_per_g pts_per_g \\\n",
+ "0 0.8 0.3 0.8 1.0 0.8 11.5 \n",
+ "1 0.7 0.3 0.0 0.7 1.0 2.7 \n",
+ "2 0.5 1.5 0.0 2.0 2.0 2.5 \n",
+ "3 1.0 0.5 0.5 1.5 1.5 8.0 \n",
+ "4 1.0 1.0 0.0 3.0 3.5 6.0 \n",
+ "\n",
+ " is_playoffs \n",
+ "0 True \n",
+ "1 True \n",
+ "2 True \n",
+ "3 True \n",
+ "4 True \n",
+ "\n",
+ "[5 rows x 27 columns]"
+ ]
+ },
+ "execution_count": 40,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "df.head()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 42,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "16\n"
+ ]
+ }
+ ],
+ "source": [
+ "df = player.stats_per_game(kind='B', level='B')\n",
+ "\n",
+ "print(len(df))"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 43,
+ "metadata": {
+ "scrolled": true
+ },
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " season | \n",
+ " lg_name | \n",
+ " g | \n",
+ " gs | \n",
+ " mp_per_g | \n",
+ " fg_per_g | \n",
+ " fga_per_g | \n",
+ " fg_pct | \n",
+ " fg3_per_g | \n",
+ " fg3a_per_g | \n",
+ " ... | \n",
+ " orb_per_g | \n",
+ " drb_per_g | \n",
+ " trb_per_g | \n",
+ " ast_per_g | \n",
+ " stl_per_g | \n",
+ " blk_per_g | \n",
+ " tov_per_g | \n",
+ " pf_per_g | \n",
+ " pts_per_g | \n",
+ " is_playoffs | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " | 0 | \n",
+ " 2007 | \n",
+ " Liga ACB | \n",
+ " 19.0 | \n",
+ " NaN | \n",
+ " 6.6 | \n",
+ " 0.9 | \n",
+ " 2.2 | \n",
+ " 0.405 | \n",
+ " 0.2 | \n",
+ " 0.7 | \n",
+ " ... | \n",
+ " 0.4 | \n",
+ " 0.6 | \n",
+ " 0.9 | \n",
+ " 0.4 | \n",
+ " 0.4 | \n",
+ " 0.2 | \n",
+ " 0.6 | \n",
+ " 0.5 | \n",
+ " 2.3 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 1 | \n",
+ " 2008 | \n",
+ " ULEB Cup, Liga ACB | \n",
+ " 48.0 | \n",
+ " NaN | \n",
+ " 17.7 | \n",
+ " 2.2 | \n",
+ " 4.6 | \n",
+ " 0.480 | \n",
+ " 0.7 | \n",
+ " 2.0 | \n",
+ " ... | \n",
+ " 0.8 | \n",
+ " 2.2 | \n",
+ " 2.9 | \n",
+ " 0.9 | \n",
+ " 0.7 | \n",
+ " 0.4 | \n",
+ " 1.3 | \n",
+ " 1.8 | \n",
+ " 5.9 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 2 | \n",
+ " 2009 | \n",
+ " Liga ACB, EuroCup | \n",
+ " 20.0 | \n",
+ " NaN | \n",
+ " 21.3 | \n",
+ " 2.5 | \n",
+ " 4.8 | \n",
+ " 0.521 | \n",
+ " 0.9 | \n",
+ " 2.2 | \n",
+ " ... | \n",
+ " 0.7 | \n",
+ " 3.4 | \n",
+ " 4.1 | \n",
+ " 0.8 | \n",
+ " 0.9 | \n",
+ " 0.6 | \n",
+ " 1.2 | \n",
+ " 2.0 | \n",
+ " 7.1 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 3 | \n",
+ " 2010 | \n",
+ " Liga ACB, EuroCup | \n",
+ " 50.0 | \n",
+ " NaN | \n",
+ " 25.6 | \n",
+ " 3.0 | \n",
+ " 6.8 | \n",
+ " 0.442 | \n",
+ " 0.9 | \n",
+ " 2.9 | \n",
+ " ... | \n",
+ " 1.0 | \n",
+ " 3.9 | \n",
+ " 4.9 | \n",
+ " 1.6 | \n",
+ " 1.0 | \n",
+ " 0.4 | \n",
+ " 1.8 | \n",
+ " 2.3 | \n",
+ " 8.2 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 4 | \n",
+ " 2011 | \n",
+ " EuroLeague, Liga ACB | \n",
+ " 38.0 | \n",
+ " NaN | \n",
+ " 28.4 | \n",
+ " 3.8 | \n",
+ " 8.2 | \n",
+ " 0.465 | \n",
+ " 1.3 | \n",
+ " 3.3 | \n",
+ " ... | \n",
+ " 1.1 | \n",
+ " 3.6 | \n",
+ " 4.7 | \n",
+ " 1.8 | \n",
+ " 1.4 | \n",
+ " 0.6 | \n",
+ " 2.2 | \n",
+ " 2.2 | \n",
+ " 11.3 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 5 | \n",
+ " 2012 | \n",
+ " EuroCup, Liga ACB | \n",
+ " 37.0 | \n",
+ " NaN | \n",
+ " 25.8 | \n",
+ " 3.0 | \n",
+ " 7.2 | \n",
+ " 0.415 | \n",
+ " 1.2 | \n",
+ " 3.4 | \n",
+ " ... | \n",
+ " 1.2 | \n",
+ " 2.4 | \n",
+ " 3.6 | \n",
+ " 1.3 | \n",
+ " 1.2 | \n",
+ " 0.4 | \n",
+ " 1.9 | \n",
+ " 2.6 | \n",
+ " 8.7 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 6 | \n",
+ " 2016 | \n",
+ " EuroLeague | \n",
+ " 31.0 | \n",
+ " NaN | \n",
+ " 27.0 | \n",
+ " 3.5 | \n",
+ " 7.0 | \n",
+ " 0.500 | \n",
+ " 1.1 | \n",
+ " 2.7 | \n",
+ " ... | \n",
+ " 1.7 | \n",
+ " 4.1 | \n",
+ " 5.9 | \n",
+ " 1.6 | \n",
+ " 0.8 | \n",
+ " 0.5 | \n",
+ " 1.0 | \n",
+ " 1.7 | \n",
+ " 9.4 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 7 | \n",
+ " 2017 | \n",
+ " EuroLeague, Liga ACB | \n",
+ " 56.0 | \n",
+ " NaN | \n",
+ " 21.2 | \n",
+ " 2.0 | \n",
+ " 4.3 | \n",
+ " 0.471 | \n",
+ " 0.9 | \n",
+ " 2.2 | \n",
+ " ... | \n",
+ " 0.8 | \n",
+ " 3.4 | \n",
+ " 4.3 | \n",
+ " 1.2 | \n",
+ " 0.9 | \n",
+ " 0.4 | \n",
+ " 1.3 | \n",
+ " 2.0 | \n",
+ " 5.5 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 8 | \n",
+ " 2018 | \n",
+ " EuroLeague, Liga ACB | \n",
+ " 29.0 | \n",
+ " NaN | \n",
+ " 14.9 | \n",
+ " 1.5 | \n",
+ " 3.4 | \n",
+ " 0.440 | \n",
+ " 0.5 | \n",
+ " 1.6 | \n",
+ " ... | \n",
+ " 0.5 | \n",
+ " 1.6 | \n",
+ " 2.1 | \n",
+ " 1.0 | \n",
+ " 0.7 | \n",
+ " 0.3 | \n",
+ " 0.4 | \n",
+ " 1.9 | \n",
+ " 4.0 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 9 | \n",
+ " 2007 | \n",
+ " Liga ACB | \n",
+ " 4.0 | \n",
+ " NaN | \n",
+ " 20.8 | \n",
+ " 4.0 | \n",
+ " 8.0 | \n",
+ " 0.500 | \n",
+ " 1.0 | \n",
+ " 3.3 | \n",
+ " ... | \n",
+ " 0.8 | \n",
+ " 1.3 | \n",
+ " 2.0 | \n",
+ " 0.8 | \n",
+ " 0.3 | \n",
+ " 0.8 | \n",
+ " 1.0 | \n",
+ " 0.8 | \n",
+ " 11.5 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | 10 | \n",
+ " 2008 | \n",
+ " Liga ACB | \n",
+ " 3.0 | \n",
+ " NaN | \n",
+ " 12.3 | \n",
+ " 0.7 | \n",
+ " 2.0 | \n",
+ " 0.333 | \n",
+ " 0.0 | \n",
+ " 0.7 | \n",
+ " ... | \n",
+ " 0.7 | \n",
+ " 1.7 | \n",
+ " 2.3 | \n",
+ " 0.7 | \n",
+ " 0.3 | \n",
+ " 0.0 | \n",
+ " 0.7 | \n",
+ " 1.0 | \n",
+ " 2.7 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | 11 | \n",
+ " 2009 | \n",
+ " Liga ACB | \n",
+ " 2.0 | \n",
+ " NaN | \n",
+ " 25.0 | \n",
+ " 0.5 | \n",
+ " 5.0 | \n",
+ " 0.100 | \n",
+ " 0.0 | \n",
+ " 2.0 | \n",
+ " ... | \n",
+ " 1.0 | \n",
+ " 3.5 | \n",
+ " 4.5 | \n",
+ " 0.5 | \n",
+ " 1.5 | \n",
+ " 0.0 | \n",
+ " 2.0 | \n",
+ " 2.0 | \n",
+ " 2.5 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | 12 | \n",
+ " 2010 | \n",
+ " Liga ACB | \n",
+ " 2.0 | \n",
+ " NaN | \n",
+ " 23.5 | \n",
+ " 3.0 | \n",
+ " 7.0 | \n",
+ " 0.429 | \n",
+ " 1.0 | \n",
+ " 3.0 | \n",
+ " ... | \n",
+ " 0.5 | \n",
+ " 2.0 | \n",
+ " 2.5 | \n",
+ " 1.0 | \n",
+ " 0.5 | \n",
+ " 0.5 | \n",
+ " 1.5 | \n",
+ " 1.5 | \n",
+ " 8.0 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | 13 | \n",
+ " 2011 | \n",
+ " Liga ACB | \n",
+ " 2.0 | \n",
+ " NaN | \n",
+ " 27.0 | \n",
+ " 2.0 | \n",
+ " 6.5 | \n",
+ " 0.308 | \n",
+ " 0.5 | \n",
+ " 2.5 | \n",
+ " ... | \n",
+ " 0.5 | \n",
+ " 2.5 | \n",
+ " 3.0 | \n",
+ " 1.0 | \n",
+ " 1.0 | \n",
+ " 0.0 | \n",
+ " 3.0 | \n",
+ " 3.5 | \n",
+ " 6.0 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | 14 | \n",
+ " 2012 | \n",
+ " Liga ACB | \n",
+ " 7.0 | \n",
+ " NaN | \n",
+ " 27.7 | \n",
+ " 2.0 | \n",
+ " 5.9 | \n",
+ " 0.341 | \n",
+ " 0.4 | \n",
+ " 2.1 | \n",
+ " ... | \n",
+ " 1.0 | \n",
+ " 3.3 | \n",
+ " 4.3 | \n",
+ " 0.9 | \n",
+ " 1.0 | \n",
+ " 0.4 | \n",
+ " 2.3 | \n",
+ " 2.9 | \n",
+ " 5.1 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | 15 | \n",
+ " 2017 | \n",
+ " Liga ACB | \n",
+ " 3.0 | \n",
+ " NaN | \n",
+ " 23.7 | \n",
+ " 2.3 | \n",
+ " 5.3 | \n",
+ " 0.438 | \n",
+ " 1.0 | \n",
+ " 2.3 | \n",
+ " ... | \n",
+ " 1.0 | \n",
+ " 3.3 | \n",
+ " 4.3 | \n",
+ " 1.0 | \n",
+ " 1.7 | \n",
+ " 0.3 | \n",
+ " 2.3 | \n",
+ " 1.3 | \n",
+ " 6.7 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
16 rows × 27 columns
\n",
+ "
"
+ ],
+ "text/plain": [
+ " season lg_name g gs mp_per_g fg_per_g fga_per_g \\\n",
+ "0 2007 Liga ACB 19.0 NaN 6.6 0.9 2.2 \n",
+ "1 2008 ULEB Cup, Liga ACB 48.0 NaN 17.7 2.2 4.6 \n",
+ "2 2009 Liga ACB, EuroCup 20.0 NaN 21.3 2.5 4.8 \n",
+ "3 2010 Liga ACB, EuroCup 50.0 NaN 25.6 3.0 6.8 \n",
+ "4 2011 EuroLeague, Liga ACB 38.0 NaN 28.4 3.8 8.2 \n",
+ "5 2012 EuroCup, Liga ACB 37.0 NaN 25.8 3.0 7.2 \n",
+ "6 2016 EuroLeague 31.0 NaN 27.0 3.5 7.0 \n",
+ "7 2017 EuroLeague, Liga ACB 56.0 NaN 21.2 2.0 4.3 \n",
+ "8 2018 EuroLeague, Liga ACB 29.0 NaN 14.9 1.5 3.4 \n",
+ "9 2007 Liga ACB 4.0 NaN 20.8 4.0 8.0 \n",
+ "10 2008 Liga ACB 3.0 NaN 12.3 0.7 2.0 \n",
+ "11 2009 Liga ACB 2.0 NaN 25.0 0.5 5.0 \n",
+ "12 2010 Liga ACB 2.0 NaN 23.5 3.0 7.0 \n",
+ "13 2011 Liga ACB 2.0 NaN 27.0 2.0 6.5 \n",
+ "14 2012 Liga ACB 7.0 NaN 27.7 2.0 5.9 \n",
+ "15 2017 Liga ACB 3.0 NaN 23.7 2.3 5.3 \n",
+ "\n",
+ " fg_pct fg3_per_g fg3a_per_g ... orb_per_g drb_per_g \\\n",
+ "0 0.405 0.2 0.7 ... 0.4 0.6 \n",
+ "1 0.480 0.7 2.0 ... 0.8 2.2 \n",
+ "2 0.521 0.9 2.2 ... 0.7 3.4 \n",
+ "3 0.442 0.9 2.9 ... 1.0 3.9 \n",
+ "4 0.465 1.3 3.3 ... 1.1 3.6 \n",
+ "5 0.415 1.2 3.4 ... 1.2 2.4 \n",
+ "6 0.500 1.1 2.7 ... 1.7 4.1 \n",
+ "7 0.471 0.9 2.2 ... 0.8 3.4 \n",
+ "8 0.440 0.5 1.6 ... 0.5 1.6 \n",
+ "9 0.500 1.0 3.3 ... 0.8 1.3 \n",
+ "10 0.333 0.0 0.7 ... 0.7 1.7 \n",
+ "11 0.100 0.0 2.0 ... 1.0 3.5 \n",
+ "12 0.429 1.0 3.0 ... 0.5 2.0 \n",
+ "13 0.308 0.5 2.5 ... 0.5 2.5 \n",
+ "14 0.341 0.4 2.1 ... 1.0 3.3 \n",
+ "15 0.438 1.0 2.3 ... 1.0 3.3 \n",
+ "\n",
+ " trb_per_g ast_per_g stl_per_g blk_per_g tov_per_g pf_per_g \\\n",
+ "0 0.9 0.4 0.4 0.2 0.6 0.5 \n",
+ "1 2.9 0.9 0.7 0.4 1.3 1.8 \n",
+ "2 4.1 0.8 0.9 0.6 1.2 2.0 \n",
+ "3 4.9 1.6 1.0 0.4 1.8 2.3 \n",
+ "4 4.7 1.8 1.4 0.6 2.2 2.2 \n",
+ "5 3.6 1.3 1.2 0.4 1.9 2.6 \n",
+ "6 5.9 1.6 0.8 0.5 1.0 1.7 \n",
+ "7 4.3 1.2 0.9 0.4 1.3 2.0 \n",
+ "8 2.1 1.0 0.7 0.3 0.4 1.9 \n",
+ "9 2.0 0.8 0.3 0.8 1.0 0.8 \n",
+ "10 2.3 0.7 0.3 0.0 0.7 1.0 \n",
+ "11 4.5 0.5 1.5 0.0 2.0 2.0 \n",
+ "12 2.5 1.0 0.5 0.5 1.5 1.5 \n",
+ "13 3.0 1.0 1.0 0.0 3.0 3.5 \n",
+ "14 4.3 0.9 1.0 0.4 2.3 2.9 \n",
+ "15 4.3 1.0 1.7 0.3 2.3 1.3 \n",
+ "\n",
+ " pts_per_g is_playoffs \n",
+ "0 2.3 False \n",
+ "1 5.9 False \n",
+ "2 7.1 False \n",
+ "3 8.2 False \n",
+ "4 11.3 False \n",
+ "5 8.7 False \n",
+ "6 9.4 False \n",
+ "7 5.5 False \n",
+ "8 4.0 False \n",
+ "9 11.5 True \n",
+ "10 2.7 True \n",
+ "11 2.5 True \n",
+ "12 8.0 True \n",
+ "13 6.0 True \n",
+ "14 5.1 True \n",
+ "15 6.7 True \n",
+ "\n",
+ "[16 rows x 27 columns]"
+ ]
+ },
+ "execution_count": 43,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "df.head(20)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Test: level='C' - Club"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "8\n"
+ ]
+ }
+ ],
+ "source": [
+ "df = player.stats_per_game(kind='R', level='C')\n",
+ "\n",
+ "print(len(df))"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " season | \n",
+ " team_name_season | \n",
+ " lg_name | \n",
+ " lg_country | \n",
+ " g | \n",
+ " gs | \n",
+ " mp_per_g | \n",
+ " fg_per_g | \n",
+ " fga_per_g | \n",
+ " fg_pct | \n",
+ " ... | \n",
+ " orb_per_g | \n",
+ " drb_per_g | \n",
+ " trb_per_g | \n",
+ " ast_per_g | \n",
+ " stl_per_g | \n",
+ " blk_per_g | \n",
+ " tov_per_g | \n",
+ " pf_per_g | \n",
+ " pts_per_g | \n",
+ " is_playoffs | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " | 0 | \n",
+ " 2007 | \n",
+ " /euro/teams/valencia/2007.html | \n",
+ " Liga ACB | \n",
+ " es | \n",
+ " 19.0 | \n",
+ " NaN | \n",
+ " 6.6 | \n",
+ " 0.9 | \n",
+ " 2.2 | \n",
+ " 0.405 | \n",
+ " ... | \n",
+ " 0.4 | \n",
+ " 0.6 | \n",
+ " 0.9 | \n",
+ " 0.4 | \n",
+ " 0.4 | \n",
+ " 0.2 | \n",
+ " 0.6 | \n",
+ " 0.5 | \n",
+ " 2.3 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 1 | \n",
+ " 2008 | \n",
+ " /euro/teams/valencia/2008.html | \n",
+ " Liga ACB | \n",
+ " es | \n",
+ " 34.0 | \n",
+ " NaN | \n",
+ " 18.1 | \n",
+ " 2.4 | \n",
+ " 4.9 | \n",
+ " 0.491 | \n",
+ " ... | \n",
+ " 0.9 | \n",
+ " 2.2 | \n",
+ " 3.1 | \n",
+ " 1.0 | \n",
+ " 0.6 | \n",
+ " 0.3 | \n",
+ " 1.3 | \n",
+ " 2.0 | \n",
+ " 6.5 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 2 | \n",
+ " 2009 | \n",
+ " /euro/teams/valencia/2009.html | \n",
+ " Liga ACB | \n",
+ " es | \n",
+ " 16.0 | \n",
+ " NaN | \n",
+ " 22.6 | \n",
+ " 2.8 | \n",
+ " 5.3 | \n",
+ " 0.529 | \n",
+ " ... | \n",
+ " 0.9 | \n",
+ " 3.6 | \n",
+ " 4.5 | \n",
+ " 0.6 | \n",
+ " 1.1 | \n",
+ " 0.5 | \n",
+ " 1.3 | \n",
+ " 2.1 | \n",
+ " 8.3 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 3 | \n",
+ " 2010 | \n",
+ " /euro/teams/valencia/2010.html | \n",
+ " Liga ACB | \n",
+ " es | \n",
+ " 34.0 | \n",
+ " NaN | \n",
+ " 25.4 | \n",
+ " 3.0 | \n",
+ " 6.7 | \n",
+ " 0.450 | \n",
+ " ... | \n",
+ " 1.0 | \n",
+ " 3.9 | \n",
+ " 4.8 | \n",
+ " 1.5 | \n",
+ " 0.9 | \n",
+ " 0.4 | \n",
+ " 1.8 | \n",
+ " 2.2 | \n",
+ " 8.2 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 4 | \n",
+ " 2011 | \n",
+ " /euro/teams/valencia/2011.html | \n",
+ " Liga ACB | \n",
+ " es | \n",
+ " 24.0 | \n",
+ " NaN | \n",
+ " 28.8 | \n",
+ " 3.9 | \n",
+ " 8.5 | \n",
+ " 0.461 | \n",
+ " ... | \n",
+ " 1.1 | \n",
+ " 3.5 | \n",
+ " 4.6 | \n",
+ " 2.1 | \n",
+ " 1.4 | \n",
+ " 0.7 | \n",
+ " 2.0 | \n",
+ " 2.0 | \n",
+ " 11.5 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
5 rows × 29 columns
\n",
+ "
"
+ ],
+ "text/plain": [
+ " season team_name_season lg_name lg_country g gs \\\n",
+ "0 2007 /euro/teams/valencia/2007.html Liga ACB es 19.0 NaN \n",
+ "1 2008 /euro/teams/valencia/2008.html Liga ACB es 34.0 NaN \n",
+ "2 2009 /euro/teams/valencia/2009.html Liga ACB es 16.0 NaN \n",
+ "3 2010 /euro/teams/valencia/2010.html Liga ACB es 34.0 NaN \n",
+ "4 2011 /euro/teams/valencia/2011.html Liga ACB es 24.0 NaN \n",
+ "\n",
+ " mp_per_g fg_per_g fga_per_g fg_pct ... orb_per_g drb_per_g \\\n",
+ "0 6.6 0.9 2.2 0.405 ... 0.4 0.6 \n",
+ "1 18.1 2.4 4.9 0.491 ... 0.9 2.2 \n",
+ "2 22.6 2.8 5.3 0.529 ... 0.9 3.6 \n",
+ "3 25.4 3.0 6.7 0.450 ... 1.0 3.9 \n",
+ "4 28.8 3.9 8.5 0.461 ... 1.1 3.5 \n",
+ "\n",
+ " trb_per_g ast_per_g stl_per_g blk_per_g tov_per_g pf_per_g pts_per_g \\\n",
+ "0 0.9 0.4 0.4 0.2 0.6 0.5 2.3 \n",
+ "1 3.1 1.0 0.6 0.3 1.3 2.0 6.5 \n",
+ "2 4.5 0.6 1.1 0.5 1.3 2.1 8.3 \n",
+ "3 4.8 1.5 0.9 0.4 1.8 2.2 8.2 \n",
+ "4 4.6 2.1 1.4 0.7 2.0 2.0 11.5 \n",
+ "\n",
+ " is_playoffs \n",
+ "0 False \n",
+ "1 False \n",
+ "2 False \n",
+ "3 False \n",
+ "4 False \n",
+ "\n",
+ "[5 rows x 29 columns]"
+ ]
+ },
+ "execution_count": 14,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "df.head()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "7\n"
+ ]
+ }
+ ],
+ "source": [
+ "df = player.stats_per_game(kind='P', level='C')\n",
+ "\n",
+ "print(len(df))"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " season | \n",
+ " team_name_season | \n",
+ " lg_name | \n",
+ " lg_country | \n",
+ " g | \n",
+ " gs | \n",
+ " mp_per_g | \n",
+ " fg_per_g | \n",
+ " fga_per_g | \n",
+ " fg_pct | \n",
+ " ... | \n",
+ " orb_per_g | \n",
+ " drb_per_g | \n",
+ " trb_per_g | \n",
+ " ast_per_g | \n",
+ " stl_per_g | \n",
+ " blk_per_g | \n",
+ " tov_per_g | \n",
+ " pf_per_g | \n",
+ " pts_per_g | \n",
+ " is_playoffs | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " | 0 | \n",
+ " 2007 | \n",
+ " /euro/teams/valencia/2007.html | \n",
+ " Liga ACB | \n",
+ " es | \n",
+ " 4.0 | \n",
+ " NaN | \n",
+ " 20.8 | \n",
+ " 4.0 | \n",
+ " 8.0 | \n",
+ " 0.500 | \n",
+ " ... | \n",
+ " 0.8 | \n",
+ " 1.3 | \n",
+ " 2.0 | \n",
+ " 0.8 | \n",
+ " 0.3 | \n",
+ " 0.8 | \n",
+ " 1.0 | \n",
+ " 0.8 | \n",
+ " 11.5 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | 1 | \n",
+ " 2008 | \n",
+ " /euro/teams/valencia/2008.html | \n",
+ " Liga ACB | \n",
+ " es | \n",
+ " 3.0 | \n",
+ " NaN | \n",
+ " 12.3 | \n",
+ " 0.7 | \n",
+ " 2.0 | \n",
+ " 0.333 | \n",
+ " ... | \n",
+ " 0.7 | \n",
+ " 1.7 | \n",
+ " 2.3 | \n",
+ " 0.7 | \n",
+ " 0.3 | \n",
+ " 0.0 | \n",
+ " 0.7 | \n",
+ " 1.0 | \n",
+ " 2.7 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | 2 | \n",
+ " 2009 | \n",
+ " /euro/teams/valencia/2009.html | \n",
+ " Liga ACB | \n",
+ " es | \n",
+ " 2.0 | \n",
+ " NaN | \n",
+ " 25.0 | \n",
+ " 0.5 | \n",
+ " 5.0 | \n",
+ " 0.100 | \n",
+ " ... | \n",
+ " 1.0 | \n",
+ " 3.5 | \n",
+ " 4.5 | \n",
+ " 0.5 | \n",
+ " 1.5 | \n",
+ " 0.0 | \n",
+ " 2.0 | \n",
+ " 2.0 | \n",
+ " 2.5 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | 3 | \n",
+ " 2010 | \n",
+ " /euro/teams/valencia/2010.html | \n",
+ " Liga ACB | \n",
+ " es | \n",
+ " 2.0 | \n",
+ " NaN | \n",
+ " 23.5 | \n",
+ " 3.0 | \n",
+ " 7.0 | \n",
+ " 0.429 | \n",
+ " ... | \n",
+ " 0.5 | \n",
+ " 2.0 | \n",
+ " 2.5 | \n",
+ " 1.0 | \n",
+ " 0.5 | \n",
+ " 0.5 | \n",
+ " 1.5 | \n",
+ " 1.5 | \n",
+ " 8.0 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | 4 | \n",
+ " 2011 | \n",
+ " /euro/teams/valencia/2011.html | \n",
+ " Liga ACB | \n",
+ " es | \n",
+ " 2.0 | \n",
+ " NaN | \n",
+ " 27.0 | \n",
+ " 2.0 | \n",
+ " 6.5 | \n",
+ " 0.308 | \n",
+ " ... | \n",
+ " 0.5 | \n",
+ " 2.5 | \n",
+ " 3.0 | \n",
+ " 1.0 | \n",
+ " 1.0 | \n",
+ " 0.0 | \n",
+ " 3.0 | \n",
+ " 3.5 | \n",
+ " 6.0 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
5 rows × 29 columns
\n",
+ "
"
+ ],
+ "text/plain": [
+ " season team_name_season lg_name lg_country g gs \\\n",
+ "0 2007 /euro/teams/valencia/2007.html Liga ACB es 4.0 NaN \n",
+ "1 2008 /euro/teams/valencia/2008.html Liga ACB es 3.0 NaN \n",
+ "2 2009 /euro/teams/valencia/2009.html Liga ACB es 2.0 NaN \n",
+ "3 2010 /euro/teams/valencia/2010.html Liga ACB es 2.0 NaN \n",
+ "4 2011 /euro/teams/valencia/2011.html Liga ACB es 2.0 NaN \n",
+ "\n",
+ " mp_per_g fg_per_g fga_per_g fg_pct ... orb_per_g drb_per_g \\\n",
+ "0 20.8 4.0 8.0 0.500 ... 0.8 1.3 \n",
+ "1 12.3 0.7 2.0 0.333 ... 0.7 1.7 \n",
+ "2 25.0 0.5 5.0 0.100 ... 1.0 3.5 \n",
+ "3 23.5 3.0 7.0 0.429 ... 0.5 2.0 \n",
+ "4 27.0 2.0 6.5 0.308 ... 0.5 2.5 \n",
+ "\n",
+ " trb_per_g ast_per_g stl_per_g blk_per_g tov_per_g pf_per_g pts_per_g \\\n",
+ "0 2.0 0.8 0.3 0.8 1.0 0.8 11.5 \n",
+ "1 2.3 0.7 0.3 0.0 0.7 1.0 2.7 \n",
+ "2 4.5 0.5 1.5 0.0 2.0 2.0 2.5 \n",
+ "3 2.5 1.0 0.5 0.5 1.5 1.5 8.0 \n",
+ "4 3.0 1.0 1.0 0.0 3.0 3.5 6.0 \n",
+ "\n",
+ " is_playoffs \n",
+ "0 True \n",
+ "1 True \n",
+ "2 True \n",
+ "3 True \n",
+ "4 True \n",
+ "\n",
+ "[5 rows x 29 columns]"
+ ]
+ },
+ "execution_count": 16,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "df.head()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 44,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "15\n"
+ ]
+ }
+ ],
+ "source": [
+ "df = player.stats_per_game(kind='B', level='C')\n",
+ "\n",
+ "print(len(df))"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 45,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " season | \n",
+ " team_name_season | \n",
+ " lg_name | \n",
+ " lg_country | \n",
+ " g | \n",
+ " gs | \n",
+ " mp_per_g | \n",
+ " fg_per_g | \n",
+ " fga_per_g | \n",
+ " fg_pct | \n",
+ " ... | \n",
+ " orb_per_g | \n",
+ " drb_per_g | \n",
+ " trb_per_g | \n",
+ " ast_per_g | \n",
+ " stl_per_g | \n",
+ " blk_per_g | \n",
+ " tov_per_g | \n",
+ " pf_per_g | \n",
+ " pts_per_g | \n",
+ " is_playoffs | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " | 0 | \n",
+ " 2007 | \n",
+ " /euro/teams/valencia/2007.html | \n",
+ " Liga ACB | \n",
+ " es | \n",
+ " 19.0 | \n",
+ " NaN | \n",
+ " 6.6 | \n",
+ " 0.9 | \n",
+ " 2.2 | \n",
+ " 0.405 | \n",
+ " ... | \n",
+ " 0.4 | \n",
+ " 0.6 | \n",
+ " 0.9 | \n",
+ " 0.4 | \n",
+ " 0.4 | \n",
+ " 0.2 | \n",
+ " 0.6 | \n",
+ " 0.5 | \n",
+ " 2.3 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 1 | \n",
+ " 2008 | \n",
+ " /euro/teams/valencia/2008.html | \n",
+ " Liga ACB | \n",
+ " es | \n",
+ " 34.0 | \n",
+ " NaN | \n",
+ " 18.1 | \n",
+ " 2.4 | \n",
+ " 4.9 | \n",
+ " 0.491 | \n",
+ " ... | \n",
+ " 0.9 | \n",
+ " 2.2 | \n",
+ " 3.1 | \n",
+ " 1.0 | \n",
+ " 0.6 | \n",
+ " 0.3 | \n",
+ " 1.3 | \n",
+ " 2.0 | \n",
+ " 6.5 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 2 | \n",
+ " 2009 | \n",
+ " /euro/teams/valencia/2009.html | \n",
+ " Liga ACB | \n",
+ " es | \n",
+ " 16.0 | \n",
+ " NaN | \n",
+ " 22.6 | \n",
+ " 2.8 | \n",
+ " 5.3 | \n",
+ " 0.529 | \n",
+ " ... | \n",
+ " 0.9 | \n",
+ " 3.6 | \n",
+ " 4.5 | \n",
+ " 0.6 | \n",
+ " 1.1 | \n",
+ " 0.5 | \n",
+ " 1.3 | \n",
+ " 2.1 | \n",
+ " 8.3 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 3 | \n",
+ " 2010 | \n",
+ " /euro/teams/valencia/2010.html | \n",
+ " Liga ACB | \n",
+ " es | \n",
+ " 34.0 | \n",
+ " NaN | \n",
+ " 25.4 | \n",
+ " 3.0 | \n",
+ " 6.7 | \n",
+ " 0.450 | \n",
+ " ... | \n",
+ " 1.0 | \n",
+ " 3.9 | \n",
+ " 4.8 | \n",
+ " 1.5 | \n",
+ " 0.9 | \n",
+ " 0.4 | \n",
+ " 1.8 | \n",
+ " 2.2 | \n",
+ " 8.2 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 4 | \n",
+ " 2011 | \n",
+ " /euro/teams/valencia/2011.html | \n",
+ " Liga ACB | \n",
+ " es | \n",
+ " 24.0 | \n",
+ " NaN | \n",
+ " 28.8 | \n",
+ " 3.9 | \n",
+ " 8.5 | \n",
+ " 0.461 | \n",
+ " ... | \n",
+ " 1.1 | \n",
+ " 3.5 | \n",
+ " 4.6 | \n",
+ " 2.1 | \n",
+ " 1.4 | \n",
+ " 0.7 | \n",
+ " 2.0 | \n",
+ " 2.0 | \n",
+ " 11.5 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 5 | \n",
+ " 2012 | \n",
+ " /euro/teams/valencia/2012.html | \n",
+ " Liga ACB | \n",
+ " es | \n",
+ " 27.0 | \n",
+ " NaN | \n",
+ " 25.3 | \n",
+ " 2.9 | \n",
+ " 7.0 | \n",
+ " 0.420 | \n",
+ " ... | \n",
+ " 1.2 | \n",
+ " 2.3 | \n",
+ " 3.5 | \n",
+ " 1.3 | \n",
+ " 1.1 | \n",
+ " 0.5 | \n",
+ " 2.0 | \n",
+ " 2.5 | \n",
+ " 8.4 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 6 | \n",
+ " 2017 | \n",
+ " /euro/teams/barcelona/2017.html | \n",
+ " Liga ACB | \n",
+ " es | \n",
+ " 29.0 | \n",
+ " NaN | \n",
+ " 20.4 | \n",
+ " 1.9 | \n",
+ " 4.0 | \n",
+ " 0.483 | \n",
+ " ... | \n",
+ " 0.8 | \n",
+ " 3.3 | \n",
+ " 4.1 | \n",
+ " 1.2 | \n",
+ " 0.9 | \n",
+ " 0.6 | \n",
+ " 1.4 | \n",
+ " 2.3 | \n",
+ " 5.0 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 7 | \n",
+ " 2018 | \n",
+ " /euro/teams/barcelona/2018.html | \n",
+ " Liga ACB | \n",
+ " es | \n",
+ " 12.0 | \n",
+ " NaN | \n",
+ " 16.6 | \n",
+ " 1.4 | \n",
+ " 3.3 | \n",
+ " 0.425 | \n",
+ " ... | \n",
+ " 0.4 | \n",
+ " 1.7 | \n",
+ " 2.1 | \n",
+ " 1.0 | \n",
+ " 0.8 | \n",
+ " 0.3 | \n",
+ " 0.5 | \n",
+ " 2.2 | \n",
+ " 3.8 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 8 | \n",
+ " 2007 | \n",
+ " /euro/teams/valencia/2007.html | \n",
+ " Liga ACB | \n",
+ " es | \n",
+ " 4.0 | \n",
+ " NaN | \n",
+ " 20.8 | \n",
+ " 4.0 | \n",
+ " 8.0 | \n",
+ " 0.500 | \n",
+ " ... | \n",
+ " 0.8 | \n",
+ " 1.3 | \n",
+ " 2.0 | \n",
+ " 0.8 | \n",
+ " 0.3 | \n",
+ " 0.8 | \n",
+ " 1.0 | \n",
+ " 0.8 | \n",
+ " 11.5 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | 9 | \n",
+ " 2008 | \n",
+ " /euro/teams/valencia/2008.html | \n",
+ " Liga ACB | \n",
+ " es | \n",
+ " 3.0 | \n",
+ " NaN | \n",
+ " 12.3 | \n",
+ " 0.7 | \n",
+ " 2.0 | \n",
+ " 0.333 | \n",
+ " ... | \n",
+ " 0.7 | \n",
+ " 1.7 | \n",
+ " 2.3 | \n",
+ " 0.7 | \n",
+ " 0.3 | \n",
+ " 0.0 | \n",
+ " 0.7 | \n",
+ " 1.0 | \n",
+ " 2.7 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | 10 | \n",
+ " 2009 | \n",
+ " /euro/teams/valencia/2009.html | \n",
+ " Liga ACB | \n",
+ " es | \n",
+ " 2.0 | \n",
+ " NaN | \n",
+ " 25.0 | \n",
+ " 0.5 | \n",
+ " 5.0 | \n",
+ " 0.100 | \n",
+ " ... | \n",
+ " 1.0 | \n",
+ " 3.5 | \n",
+ " 4.5 | \n",
+ " 0.5 | \n",
+ " 1.5 | \n",
+ " 0.0 | \n",
+ " 2.0 | \n",
+ " 2.0 | \n",
+ " 2.5 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | 11 | \n",
+ " 2010 | \n",
+ " /euro/teams/valencia/2010.html | \n",
+ " Liga ACB | \n",
+ " es | \n",
+ " 2.0 | \n",
+ " NaN | \n",
+ " 23.5 | \n",
+ " 3.0 | \n",
+ " 7.0 | \n",
+ " 0.429 | \n",
+ " ... | \n",
+ " 0.5 | \n",
+ " 2.0 | \n",
+ " 2.5 | \n",
+ " 1.0 | \n",
+ " 0.5 | \n",
+ " 0.5 | \n",
+ " 1.5 | \n",
+ " 1.5 | \n",
+ " 8.0 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | 12 | \n",
+ " 2011 | \n",
+ " /euro/teams/valencia/2011.html | \n",
+ " Liga ACB | \n",
+ " es | \n",
+ " 2.0 | \n",
+ " NaN | \n",
+ " 27.0 | \n",
+ " 2.0 | \n",
+ " 6.5 | \n",
+ " 0.308 | \n",
+ " ... | \n",
+ " 0.5 | \n",
+ " 2.5 | \n",
+ " 3.0 | \n",
+ " 1.0 | \n",
+ " 1.0 | \n",
+ " 0.0 | \n",
+ " 3.0 | \n",
+ " 3.5 | \n",
+ " 6.0 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | 13 | \n",
+ " 2012 | \n",
+ " /euro/teams/valencia/2012.html | \n",
+ " Liga ACB | \n",
+ " es | \n",
+ " 7.0 | \n",
+ " NaN | \n",
+ " 27.7 | \n",
+ " 2.0 | \n",
+ " 5.9 | \n",
+ " 0.341 | \n",
+ " ... | \n",
+ " 1.0 | \n",
+ " 3.3 | \n",
+ " 4.3 | \n",
+ " 0.9 | \n",
+ " 1.0 | \n",
+ " 0.4 | \n",
+ " 2.3 | \n",
+ " 2.9 | \n",
+ " 5.1 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | 14 | \n",
+ " 2017 | \n",
+ " /euro/teams/barcelona/2017.html | \n",
+ " Liga ACB | \n",
+ " es | \n",
+ " 3.0 | \n",
+ " NaN | \n",
+ " 23.7 | \n",
+ " 2.3 | \n",
+ " 5.3 | \n",
+ " 0.438 | \n",
+ " ... | \n",
+ " 1.0 | \n",
+ " 3.3 | \n",
+ " 4.3 | \n",
+ " 1.0 | \n",
+ " 1.7 | \n",
+ " 0.3 | \n",
+ " 2.3 | \n",
+ " 1.3 | \n",
+ " 6.7 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
15 rows × 29 columns
\n",
+ "
"
+ ],
+ "text/plain": [
+ " season team_name_season lg_name lg_country g gs \\\n",
+ "0 2007 /euro/teams/valencia/2007.html Liga ACB es 19.0 NaN \n",
+ "1 2008 /euro/teams/valencia/2008.html Liga ACB es 34.0 NaN \n",
+ "2 2009 /euro/teams/valencia/2009.html Liga ACB es 16.0 NaN \n",
+ "3 2010 /euro/teams/valencia/2010.html Liga ACB es 34.0 NaN \n",
+ "4 2011 /euro/teams/valencia/2011.html Liga ACB es 24.0 NaN \n",
+ "5 2012 /euro/teams/valencia/2012.html Liga ACB es 27.0 NaN \n",
+ "6 2017 /euro/teams/barcelona/2017.html Liga ACB es 29.0 NaN \n",
+ "7 2018 /euro/teams/barcelona/2018.html Liga ACB es 12.0 NaN \n",
+ "8 2007 /euro/teams/valencia/2007.html Liga ACB es 4.0 NaN \n",
+ "9 2008 /euro/teams/valencia/2008.html Liga ACB es 3.0 NaN \n",
+ "10 2009 /euro/teams/valencia/2009.html Liga ACB es 2.0 NaN \n",
+ "11 2010 /euro/teams/valencia/2010.html Liga ACB es 2.0 NaN \n",
+ "12 2011 /euro/teams/valencia/2011.html Liga ACB es 2.0 NaN \n",
+ "13 2012 /euro/teams/valencia/2012.html Liga ACB es 7.0 NaN \n",
+ "14 2017 /euro/teams/barcelona/2017.html Liga ACB es 3.0 NaN \n",
+ "\n",
+ " mp_per_g fg_per_g fga_per_g fg_pct ... orb_per_g drb_per_g \\\n",
+ "0 6.6 0.9 2.2 0.405 ... 0.4 0.6 \n",
+ "1 18.1 2.4 4.9 0.491 ... 0.9 2.2 \n",
+ "2 22.6 2.8 5.3 0.529 ... 0.9 3.6 \n",
+ "3 25.4 3.0 6.7 0.450 ... 1.0 3.9 \n",
+ "4 28.8 3.9 8.5 0.461 ... 1.1 3.5 \n",
+ "5 25.3 2.9 7.0 0.420 ... 1.2 2.3 \n",
+ "6 20.4 1.9 4.0 0.483 ... 0.8 3.3 \n",
+ "7 16.6 1.4 3.3 0.425 ... 0.4 1.7 \n",
+ "8 20.8 4.0 8.0 0.500 ... 0.8 1.3 \n",
+ "9 12.3 0.7 2.0 0.333 ... 0.7 1.7 \n",
+ "10 25.0 0.5 5.0 0.100 ... 1.0 3.5 \n",
+ "11 23.5 3.0 7.0 0.429 ... 0.5 2.0 \n",
+ "12 27.0 2.0 6.5 0.308 ... 0.5 2.5 \n",
+ "13 27.7 2.0 5.9 0.341 ... 1.0 3.3 \n",
+ "14 23.7 2.3 5.3 0.438 ... 1.0 3.3 \n",
+ "\n",
+ " trb_per_g ast_per_g stl_per_g blk_per_g tov_per_g pf_per_g \\\n",
+ "0 0.9 0.4 0.4 0.2 0.6 0.5 \n",
+ "1 3.1 1.0 0.6 0.3 1.3 2.0 \n",
+ "2 4.5 0.6 1.1 0.5 1.3 2.1 \n",
+ "3 4.8 1.5 0.9 0.4 1.8 2.2 \n",
+ "4 4.6 2.1 1.4 0.7 2.0 2.0 \n",
+ "5 3.5 1.3 1.1 0.5 2.0 2.5 \n",
+ "6 4.1 1.2 0.9 0.6 1.4 2.3 \n",
+ "7 2.1 1.0 0.8 0.3 0.5 2.2 \n",
+ "8 2.0 0.8 0.3 0.8 1.0 0.8 \n",
+ "9 2.3 0.7 0.3 0.0 0.7 1.0 \n",
+ "10 4.5 0.5 1.5 0.0 2.0 2.0 \n",
+ "11 2.5 1.0 0.5 0.5 1.5 1.5 \n",
+ "12 3.0 1.0 1.0 0.0 3.0 3.5 \n",
+ "13 4.3 0.9 1.0 0.4 2.3 2.9 \n",
+ "14 4.3 1.0 1.7 0.3 2.3 1.3 \n",
+ "\n",
+ " pts_per_g is_playoffs \n",
+ "0 2.3 False \n",
+ "1 6.5 False \n",
+ "2 8.3 False \n",
+ "3 8.2 False \n",
+ "4 11.5 False \n",
+ "5 8.4 False \n",
+ "6 5.0 False \n",
+ "7 3.8 False \n",
+ "8 11.5 True \n",
+ "9 2.7 True \n",
+ "10 2.5 True \n",
+ "11 8.0 True \n",
+ "12 6.0 True \n",
+ "13 5.1 True \n",
+ "14 6.7 True \n",
+ "\n",
+ "[15 rows x 29 columns]"
+ ]
+ },
+ "execution_count": 45,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "df.head(20)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Test: level='E' - Eurocup/Euroleague (because Eurocup/Euroleague will never have sep playoffs, kind modifier does nothing) -> need to deal with duplicate when kind='B' "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 46,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "16\n"
+ ]
+ }
+ ],
+ "source": [
+ "df = player.stats_per_game(kind='B', level='E')\n",
+ "\n",
+ "print(len(df))"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 47,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " season | \n",
+ " team_name_season | \n",
+ " lg_name | \n",
+ " g | \n",
+ " gs | \n",
+ " mp_per_g | \n",
+ " fg_per_g | \n",
+ " fga_per_g | \n",
+ " fg_pct | \n",
+ " fg3_per_g | \n",
+ " ... | \n",
+ " orb_per_g | \n",
+ " drb_per_g | \n",
+ " trb_per_g | \n",
+ " ast_per_g | \n",
+ " stl_per_g | \n",
+ " blk_per_g | \n",
+ " tov_per_g | \n",
+ " pf_per_g | \n",
+ " pts_per_g | \n",
+ " is_playoffs | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " | 0 | \n",
+ " 2008 | \n",
+ " /euro/teams/valencia/2008.html | \n",
+ " ULEB Cup | \n",
+ " 14.0 | \n",
+ " NaN | \n",
+ " 16.6 | \n",
+ " 1.8 | \n",
+ " 4.0 | \n",
+ " 0.446 | \n",
+ " 0.6 | \n",
+ " ... | \n",
+ " 0.4 | \n",
+ " 2.1 | \n",
+ " 2.5 | \n",
+ " 0.6 | \n",
+ " 0.9 | \n",
+ " 0.6 | \n",
+ " 1.3 | \n",
+ " 1.4 | \n",
+ " 4.4 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 1 | \n",
+ " 2009 | \n",
+ " /euro/teams/valencia/2009.html | \n",
+ " EuroCup | \n",
+ " 4.0 | \n",
+ " NaN | \n",
+ " 15.8 | \n",
+ " 1.3 | \n",
+ " 2.8 | \n",
+ " 0.455 | \n",
+ " 0.0 | \n",
+ " ... | \n",
+ " 0.0 | \n",
+ " 2.5 | \n",
+ " 2.5 | \n",
+ " 1.5 | \n",
+ " 0.0 | \n",
+ " 0.8 | \n",
+ " 1.0 | \n",
+ " 1.3 | \n",
+ " 2.5 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 2 | \n",
+ " 2010 | \n",
+ " /euro/teams/valencia/2010.html | \n",
+ " EuroCup | \n",
+ " 16.0 | \n",
+ " NaN | \n",
+ " 26.1 | \n",
+ " 2.9 | \n",
+ " 6.9 | \n",
+ " 0.427 | \n",
+ " 1.0 | \n",
+ " ... | \n",
+ " 1.2 | \n",
+ " 3.9 | \n",
+ " 5.1 | \n",
+ " 1.7 | \n",
+ " 1.1 | \n",
+ " 0.4 | \n",
+ " 1.7 | \n",
+ " 2.4 | \n",
+ " 8.3 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 3 | \n",
+ " 2011 | \n",
+ " /euro/teams/valencia/2011.html | \n",
+ " EuroLeague | \n",
+ " 14.0 | \n",
+ " NaN | \n",
+ " 27.6 | \n",
+ " 3.6 | \n",
+ " 7.7 | \n",
+ " 0.472 | \n",
+ " 1.0 | \n",
+ " ... | \n",
+ " 0.9 | \n",
+ " 3.9 | \n",
+ " 4.9 | \n",
+ " 1.4 | \n",
+ " 1.4 | \n",
+ " 0.4 | \n",
+ " 2.5 | \n",
+ " 2.5 | \n",
+ " 10.9 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 4 | \n",
+ " 2012 | \n",
+ " /euro/teams/valencia/2012.html | \n",
+ " EuroCup | \n",
+ " 10.0 | \n",
+ " NaN | \n",
+ " 27.3 | \n",
+ " 3.1 | \n",
+ " 7.7 | \n",
+ " 0.403 | \n",
+ " 1.2 | \n",
+ " ... | \n",
+ " 1.2 | \n",
+ " 2.5 | \n",
+ " 3.7 | \n",
+ " 1.3 | \n",
+ " 1.5 | \n",
+ " 0.2 | \n",
+ " 1.8 | \n",
+ " 3.0 | \n",
+ " 9.4 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
5 rows × 28 columns
\n",
+ "
"
+ ],
+ "text/plain": [
+ " season team_name_season lg_name g gs mp_per_g \\\n",
+ "0 2008 /euro/teams/valencia/2008.html ULEB Cup 14.0 NaN 16.6 \n",
+ "1 2009 /euro/teams/valencia/2009.html EuroCup 4.0 NaN 15.8 \n",
+ "2 2010 /euro/teams/valencia/2010.html EuroCup 16.0 NaN 26.1 \n",
+ "3 2011 /euro/teams/valencia/2011.html EuroLeague 14.0 NaN 27.6 \n",
+ "4 2012 /euro/teams/valencia/2012.html EuroCup 10.0 NaN 27.3 \n",
+ "\n",
+ " fg_per_g fga_per_g fg_pct fg3_per_g ... orb_per_g drb_per_g \\\n",
+ "0 1.8 4.0 0.446 0.6 ... 0.4 2.1 \n",
+ "1 1.3 2.8 0.455 0.0 ... 0.0 2.5 \n",
+ "2 2.9 6.9 0.427 1.0 ... 1.2 3.9 \n",
+ "3 3.6 7.7 0.472 1.0 ... 0.9 3.9 \n",
+ "4 3.1 7.7 0.403 1.2 ... 1.2 2.5 \n",
+ "\n",
+ " trb_per_g ast_per_g stl_per_g blk_per_g tov_per_g pf_per_g pts_per_g \\\n",
+ "0 2.5 0.6 0.9 0.6 1.3 1.4 4.4 \n",
+ "1 2.5 1.5 0.0 0.8 1.0 1.3 2.5 \n",
+ "2 5.1 1.7 1.1 0.4 1.7 2.4 8.3 \n",
+ "3 4.9 1.4 1.4 0.4 2.5 2.5 10.9 \n",
+ "4 3.7 1.3 1.5 0.2 1.8 3.0 9.4 \n",
+ "\n",
+ " is_playoffs \n",
+ "0 False \n",
+ "1 False \n",
+ "2 False \n",
+ "3 False \n",
+ "4 False \n",
+ "\n",
+ "[5 rows x 28 columns]"
+ ]
+ },
+ "execution_count": 47,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "df.head()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 48,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "8\n"
+ ]
+ }
+ ],
+ "source": [
+ "df = player.stats_per_game(kind='R', level='E')\n",
+ "\n",
+ "print(len(df))"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 49,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " season | \n",
+ " team_name_season | \n",
+ " lg_name | \n",
+ " g | \n",
+ " gs | \n",
+ " mp_per_g | \n",
+ " fg_per_g | \n",
+ " fga_per_g | \n",
+ " fg_pct | \n",
+ " fg3_per_g | \n",
+ " ... | \n",
+ " orb_per_g | \n",
+ " drb_per_g | \n",
+ " trb_per_g | \n",
+ " ast_per_g | \n",
+ " stl_per_g | \n",
+ " blk_per_g | \n",
+ " tov_per_g | \n",
+ " pf_per_g | \n",
+ " pts_per_g | \n",
+ " is_playoffs | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " | 0 | \n",
+ " 2008 | \n",
+ " /euro/teams/valencia/2008.html | \n",
+ " ULEB Cup | \n",
+ " 14.0 | \n",
+ " NaN | \n",
+ " 16.6 | \n",
+ " 1.8 | \n",
+ " 4.0 | \n",
+ " 0.446 | \n",
+ " 0.6 | \n",
+ " ... | \n",
+ " 0.4 | \n",
+ " 2.1 | \n",
+ " 2.5 | \n",
+ " 0.6 | \n",
+ " 0.9 | \n",
+ " 0.6 | \n",
+ " 1.3 | \n",
+ " 1.4 | \n",
+ " 4.4 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 1 | \n",
+ " 2009 | \n",
+ " /euro/teams/valencia/2009.html | \n",
+ " EuroCup | \n",
+ " 4.0 | \n",
+ " NaN | \n",
+ " 15.8 | \n",
+ " 1.3 | \n",
+ " 2.8 | \n",
+ " 0.455 | \n",
+ " 0.0 | \n",
+ " ... | \n",
+ " 0.0 | \n",
+ " 2.5 | \n",
+ " 2.5 | \n",
+ " 1.5 | \n",
+ " 0.0 | \n",
+ " 0.8 | \n",
+ " 1.0 | \n",
+ " 1.3 | \n",
+ " 2.5 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 2 | \n",
+ " 2010 | \n",
+ " /euro/teams/valencia/2010.html | \n",
+ " EuroCup | \n",
+ " 16.0 | \n",
+ " NaN | \n",
+ " 26.1 | \n",
+ " 2.9 | \n",
+ " 6.9 | \n",
+ " 0.427 | \n",
+ " 1.0 | \n",
+ " ... | \n",
+ " 1.2 | \n",
+ " 3.9 | \n",
+ " 5.1 | \n",
+ " 1.7 | \n",
+ " 1.1 | \n",
+ " 0.4 | \n",
+ " 1.7 | \n",
+ " 2.4 | \n",
+ " 8.3 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 3 | \n",
+ " 2011 | \n",
+ " /euro/teams/valencia/2011.html | \n",
+ " EuroLeague | \n",
+ " 14.0 | \n",
+ " NaN | \n",
+ " 27.6 | \n",
+ " 3.6 | \n",
+ " 7.7 | \n",
+ " 0.472 | \n",
+ " 1.0 | \n",
+ " ... | \n",
+ " 0.9 | \n",
+ " 3.9 | \n",
+ " 4.9 | \n",
+ " 1.4 | \n",
+ " 1.4 | \n",
+ " 0.4 | \n",
+ " 2.5 | \n",
+ " 2.5 | \n",
+ " 10.9 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 4 | \n",
+ " 2012 | \n",
+ " /euro/teams/valencia/2012.html | \n",
+ " EuroCup | \n",
+ " 10.0 | \n",
+ " NaN | \n",
+ " 27.3 | \n",
+ " 3.1 | \n",
+ " 7.7 | \n",
+ " 0.403 | \n",
+ " 1.2 | \n",
+ " ... | \n",
+ " 1.2 | \n",
+ " 2.5 | \n",
+ " 3.7 | \n",
+ " 1.3 | \n",
+ " 1.5 | \n",
+ " 0.2 | \n",
+ " 1.8 | \n",
+ " 3.0 | \n",
+ " 9.4 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
5 rows × 28 columns
\n",
+ "
"
+ ],
+ "text/plain": [
+ " season team_name_season lg_name g gs mp_per_g \\\n",
+ "0 2008 /euro/teams/valencia/2008.html ULEB Cup 14.0 NaN 16.6 \n",
+ "1 2009 /euro/teams/valencia/2009.html EuroCup 4.0 NaN 15.8 \n",
+ "2 2010 /euro/teams/valencia/2010.html EuroCup 16.0 NaN 26.1 \n",
+ "3 2011 /euro/teams/valencia/2011.html EuroLeague 14.0 NaN 27.6 \n",
+ "4 2012 /euro/teams/valencia/2012.html EuroCup 10.0 NaN 27.3 \n",
+ "\n",
+ " fg_per_g fga_per_g fg_pct fg3_per_g ... orb_per_g drb_per_g \\\n",
+ "0 1.8 4.0 0.446 0.6 ... 0.4 2.1 \n",
+ "1 1.3 2.8 0.455 0.0 ... 0.0 2.5 \n",
+ "2 2.9 6.9 0.427 1.0 ... 1.2 3.9 \n",
+ "3 3.6 7.7 0.472 1.0 ... 0.9 3.9 \n",
+ "4 3.1 7.7 0.403 1.2 ... 1.2 2.5 \n",
+ "\n",
+ " trb_per_g ast_per_g stl_per_g blk_per_g tov_per_g pf_per_g pts_per_g \\\n",
+ "0 2.5 0.6 0.9 0.6 1.3 1.4 4.4 \n",
+ "1 2.5 1.5 0.0 0.8 1.0 1.3 2.5 \n",
+ "2 5.1 1.7 1.1 0.4 1.7 2.4 8.3 \n",
+ "3 4.9 1.4 1.4 0.4 2.5 2.5 10.9 \n",
+ "4 3.7 1.3 1.5 0.2 1.8 3.0 9.4 \n",
+ "\n",
+ " is_playoffs \n",
+ "0 False \n",
+ "1 False \n",
+ "2 False \n",
+ "3 False \n",
+ "4 False \n",
+ "\n",
+ "[5 rows x 28 columns]"
+ ]
+ },
+ "execution_count": 49,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "df.head()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 50,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "8\n"
+ ]
+ }
+ ],
+ "source": [
+ "df = player.stats_per_game(kind='P', level='E')\n",
+ "\n",
+ "print(len(df))"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 51,
+ "metadata": {
+ "scrolled": true
+ },
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " season | \n",
+ " team_name_season | \n",
+ " lg_name | \n",
+ " g | \n",
+ " gs | \n",
+ " mp_per_g | \n",
+ " fg_per_g | \n",
+ " fga_per_g | \n",
+ " fg_pct | \n",
+ " fg3_per_g | \n",
+ " ... | \n",
+ " orb_per_g | \n",
+ " drb_per_g | \n",
+ " trb_per_g | \n",
+ " ast_per_g | \n",
+ " stl_per_g | \n",
+ " blk_per_g | \n",
+ " tov_per_g | \n",
+ " pf_per_g | \n",
+ " pts_per_g | \n",
+ " is_playoffs | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " | 0 | \n",
+ " 2008 | \n",
+ " /euro/teams/valencia/2008.html | \n",
+ " ULEB Cup | \n",
+ " 14.0 | \n",
+ " NaN | \n",
+ " 16.6 | \n",
+ " 1.8 | \n",
+ " 4.0 | \n",
+ " 0.446 | \n",
+ " 0.6 | \n",
+ " ... | \n",
+ " 0.4 | \n",
+ " 2.1 | \n",
+ " 2.5 | \n",
+ " 0.6 | \n",
+ " 0.9 | \n",
+ " 0.6 | \n",
+ " 1.3 | \n",
+ " 1.4 | \n",
+ " 4.4 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | 1 | \n",
+ " 2009 | \n",
+ " /euro/teams/valencia/2009.html | \n",
+ " EuroCup | \n",
+ " 4.0 | \n",
+ " NaN | \n",
+ " 15.8 | \n",
+ " 1.3 | \n",
+ " 2.8 | \n",
+ " 0.455 | \n",
+ " 0.0 | \n",
+ " ... | \n",
+ " 0.0 | \n",
+ " 2.5 | \n",
+ " 2.5 | \n",
+ " 1.5 | \n",
+ " 0.0 | \n",
+ " 0.8 | \n",
+ " 1.0 | \n",
+ " 1.3 | \n",
+ " 2.5 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | 2 | \n",
+ " 2010 | \n",
+ " /euro/teams/valencia/2010.html | \n",
+ " EuroCup | \n",
+ " 16.0 | \n",
+ " NaN | \n",
+ " 26.1 | \n",
+ " 2.9 | \n",
+ " 6.9 | \n",
+ " 0.427 | \n",
+ " 1.0 | \n",
+ " ... | \n",
+ " 1.2 | \n",
+ " 3.9 | \n",
+ " 5.1 | \n",
+ " 1.7 | \n",
+ " 1.1 | \n",
+ " 0.4 | \n",
+ " 1.7 | \n",
+ " 2.4 | \n",
+ " 8.3 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | 3 | \n",
+ " 2011 | \n",
+ " /euro/teams/valencia/2011.html | \n",
+ " EuroLeague | \n",
+ " 14.0 | \n",
+ " NaN | \n",
+ " 27.6 | \n",
+ " 3.6 | \n",
+ " 7.7 | \n",
+ " 0.472 | \n",
+ " 1.0 | \n",
+ " ... | \n",
+ " 0.9 | \n",
+ " 3.9 | \n",
+ " 4.9 | \n",
+ " 1.4 | \n",
+ " 1.4 | \n",
+ " 0.4 | \n",
+ " 2.5 | \n",
+ " 2.5 | \n",
+ " 10.9 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | 4 | \n",
+ " 2012 | \n",
+ " /euro/teams/valencia/2012.html | \n",
+ " EuroCup | \n",
+ " 10.0 | \n",
+ " NaN | \n",
+ " 27.3 | \n",
+ " 3.1 | \n",
+ " 7.7 | \n",
+ " 0.403 | \n",
+ " 1.2 | \n",
+ " ... | \n",
+ " 1.2 | \n",
+ " 2.5 | \n",
+ " 3.7 | \n",
+ " 1.3 | \n",
+ " 1.5 | \n",
+ " 0.2 | \n",
+ " 1.8 | \n",
+ " 3.0 | \n",
+ " 9.4 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
5 rows × 28 columns
\n",
+ "
"
+ ],
+ "text/plain": [
+ " season team_name_season lg_name g gs mp_per_g \\\n",
+ "0 2008 /euro/teams/valencia/2008.html ULEB Cup 14.0 NaN 16.6 \n",
+ "1 2009 /euro/teams/valencia/2009.html EuroCup 4.0 NaN 15.8 \n",
+ "2 2010 /euro/teams/valencia/2010.html EuroCup 16.0 NaN 26.1 \n",
+ "3 2011 /euro/teams/valencia/2011.html EuroLeague 14.0 NaN 27.6 \n",
+ "4 2012 /euro/teams/valencia/2012.html EuroCup 10.0 NaN 27.3 \n",
+ "\n",
+ " fg_per_g fga_per_g fg_pct fg3_per_g ... orb_per_g drb_per_g \\\n",
+ "0 1.8 4.0 0.446 0.6 ... 0.4 2.1 \n",
+ "1 1.3 2.8 0.455 0.0 ... 0.0 2.5 \n",
+ "2 2.9 6.9 0.427 1.0 ... 1.2 3.9 \n",
+ "3 3.6 7.7 0.472 1.0 ... 0.9 3.9 \n",
+ "4 3.1 7.7 0.403 1.2 ... 1.2 2.5 \n",
+ "\n",
+ " trb_per_g ast_per_g stl_per_g blk_per_g tov_per_g pf_per_g pts_per_g \\\n",
+ "0 2.5 0.6 0.9 0.6 1.3 1.4 4.4 \n",
+ "1 2.5 1.5 0.0 0.8 1.0 1.3 2.5 \n",
+ "2 5.1 1.7 1.1 0.4 1.7 2.4 8.3 \n",
+ "3 4.9 1.4 1.4 0.4 2.5 2.5 10.9 \n",
+ "4 3.7 1.3 1.5 0.2 1.8 3.0 9.4 \n",
+ "\n",
+ " is_playoffs \n",
+ "0 True \n",
+ "1 True \n",
+ "2 True \n",
+ "3 True \n",
+ "4 True \n",
+ "\n",
+ "[5 rows x 28 columns]"
+ ]
+ },
+ "execution_count": 51,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "df.head()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## stats_totals and stats_per36 params are the same as stats_per_game shown above"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 52,
+ "metadata": {
+ "scrolled": true
+ },
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " season | \n",
+ " team_name_season | \n",
+ " lg_name | \n",
+ " g | \n",
+ " gs | \n",
+ " mp | \n",
+ " fg | \n",
+ " fga | \n",
+ " fg_pct | \n",
+ " fg3 | \n",
+ " ... | \n",
+ " orb | \n",
+ " drb | \n",
+ " trb | \n",
+ " ast | \n",
+ " stl | \n",
+ " blk | \n",
+ " tov | \n",
+ " pf | \n",
+ " pts | \n",
+ " is_playoffs | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " | 0 | \n",
+ " 2008 | \n",
+ " /euro/teams/valencia/2008.html | \n",
+ " ULEB Cup | \n",
+ " 14.0 | \n",
+ " NaN | \n",
+ " 232.0 | \n",
+ " 25.0 | \n",
+ " 56.0 | \n",
+ " 0.446 | \n",
+ " 8.0 | \n",
+ " ... | \n",
+ " 6.0 | \n",
+ " 29.0 | \n",
+ " 35.0 | \n",
+ " 9.0 | \n",
+ " 13.0 | \n",
+ " 8.0 | \n",
+ " 18.0 | \n",
+ " 19.0 | \n",
+ " 61.0 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | 1 | \n",
+ " 2009 | \n",
+ " /euro/teams/valencia/2009.html | \n",
+ " EuroCup | \n",
+ " 4.0 | \n",
+ " NaN | \n",
+ " 63.0 | \n",
+ " 5.0 | \n",
+ " 11.0 | \n",
+ " 0.455 | \n",
+ " 0.0 | \n",
+ " ... | \n",
+ " 0.0 | \n",
+ " 10.0 | \n",
+ " 10.0 | \n",
+ " 6.0 | \n",
+ " 0.0 | \n",
+ " 3.0 | \n",
+ " 4.0 | \n",
+ " 5.0 | \n",
+ " 10.0 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | 2 | \n",
+ " 2010 | \n",
+ " /euro/teams/valencia/2010.html | \n",
+ " EuroCup | \n",
+ " 16.0 | \n",
+ " NaN | \n",
+ " 418.0 | \n",
+ " 47.0 | \n",
+ " 110.0 | \n",
+ " 0.427 | \n",
+ " 16.0 | \n",
+ " ... | \n",
+ " 19.0 | \n",
+ " 62.0 | \n",
+ " 81.0 | \n",
+ " 27.0 | \n",
+ " 17.0 | \n",
+ " 7.0 | \n",
+ " 27.0 | \n",
+ " 39.0 | \n",
+ " 132.0 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | 3 | \n",
+ " 2011 | \n",
+ " /euro/teams/valencia/2011.html | \n",
+ " EuroLeague | \n",
+ " 14.0 | \n",
+ " NaN | \n",
+ " 386.0 | \n",
+ " 51.0 | \n",
+ " 108.0 | \n",
+ " 0.472 | \n",
+ " 14.0 | \n",
+ " ... | \n",
+ " 13.0 | \n",
+ " 55.0 | \n",
+ " 68.0 | \n",
+ " 19.0 | \n",
+ " 20.0 | \n",
+ " 5.0 | \n",
+ " 35.0 | \n",
+ " 35.0 | \n",
+ " 153.0 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | 4 | \n",
+ " 2012 | \n",
+ " /euro/teams/valencia/2012.html | \n",
+ " EuroCup | \n",
+ " 10.0 | \n",
+ " NaN | \n",
+ " 273.0 | \n",
+ " 31.0 | \n",
+ " 77.0 | \n",
+ " 0.403 | \n",
+ " 12.0 | \n",
+ " ... | \n",
+ " 12.0 | \n",
+ " 25.0 | \n",
+ " 37.0 | \n",
+ " 13.0 | \n",
+ " 15.0 | \n",
+ " 2.0 | \n",
+ " 18.0 | \n",
+ " 30.0 | \n",
+ " 94.0 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
5 rows × 28 columns
\n",
+ "
"
+ ],
+ "text/plain": [
+ " season team_name_season lg_name g gs mp fg \\\n",
+ "0 2008 /euro/teams/valencia/2008.html ULEB Cup 14.0 NaN 232.0 25.0 \n",
+ "1 2009 /euro/teams/valencia/2009.html EuroCup 4.0 NaN 63.0 5.0 \n",
+ "2 2010 /euro/teams/valencia/2010.html EuroCup 16.0 NaN 418.0 47.0 \n",
+ "3 2011 /euro/teams/valencia/2011.html EuroLeague 14.0 NaN 386.0 51.0 \n",
+ "4 2012 /euro/teams/valencia/2012.html EuroCup 10.0 NaN 273.0 31.0 \n",
+ "\n",
+ " fga fg_pct fg3 ... orb drb trb ast stl blk tov \\\n",
+ "0 56.0 0.446 8.0 ... 6.0 29.0 35.0 9.0 13.0 8.0 18.0 \n",
+ "1 11.0 0.455 0.0 ... 0.0 10.0 10.0 6.0 0.0 3.0 4.0 \n",
+ "2 110.0 0.427 16.0 ... 19.0 62.0 81.0 27.0 17.0 7.0 27.0 \n",
+ "3 108.0 0.472 14.0 ... 13.0 55.0 68.0 19.0 20.0 5.0 35.0 \n",
+ "4 77.0 0.403 12.0 ... 12.0 25.0 37.0 13.0 15.0 2.0 18.0 \n",
+ "\n",
+ " pf pts is_playoffs \n",
+ "0 19.0 61.0 True \n",
+ "1 5.0 10.0 True \n",
+ "2 39.0 132.0 True \n",
+ "3 35.0 153.0 True \n",
+ "4 30.0 94.0 True \n",
+ "\n",
+ "[5 rows x 28 columns]"
+ ]
+ },
+ "execution_count": 52,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "player.stats_totals(kind='P', level='E').head()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 53,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " season | \n",
+ " team_name_season | \n",
+ " lg_name | \n",
+ " g | \n",
+ " gs | \n",
+ " mp | \n",
+ " fg_per_mp | \n",
+ " fga_per_mp | \n",
+ " fg_pct | \n",
+ " fg3_per_mp | \n",
+ " ... | \n",
+ " orb_per_mp | \n",
+ " drb_per_mp | \n",
+ " trb_per_mp | \n",
+ " ast_per_mp | \n",
+ " stl_per_mp | \n",
+ " blk_per_mp | \n",
+ " tov_per_mp | \n",
+ " pf_per_mp | \n",
+ " pts_per_mp | \n",
+ " is_playoffs | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " | 0 | \n",
+ " 2008 | \n",
+ " /euro/teams/valencia/2008.html | \n",
+ " ULEB Cup | \n",
+ " 14.0 | \n",
+ " NaN | \n",
+ " 232.0 | \n",
+ " 3.9 | \n",
+ " 8.7 | \n",
+ " 0.446 | \n",
+ " 1.2 | \n",
+ " ... | \n",
+ " 0.9 | \n",
+ " 4.5 | \n",
+ " 5.4 | \n",
+ " 1.4 | \n",
+ " 2.0 | \n",
+ " 1.2 | \n",
+ " 2.8 | \n",
+ " 2.9 | \n",
+ " 9.5 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | 1 | \n",
+ " 2009 | \n",
+ " /euro/teams/valencia/2009.html | \n",
+ " EuroCup | \n",
+ " 4.0 | \n",
+ " NaN | \n",
+ " 63.0 | \n",
+ " 2.9 | \n",
+ " 6.3 | \n",
+ " 0.455 | \n",
+ " 0.0 | \n",
+ " ... | \n",
+ " 0.0 | \n",
+ " 5.7 | \n",
+ " 5.7 | \n",
+ " 3.4 | \n",
+ " 0.0 | \n",
+ " 1.7 | \n",
+ " 2.3 | \n",
+ " 2.9 | \n",
+ " 5.7 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | 2 | \n",
+ " 2010 | \n",
+ " /euro/teams/valencia/2010.html | \n",
+ " EuroCup | \n",
+ " 16.0 | \n",
+ " NaN | \n",
+ " 418.0 | \n",
+ " 4.0 | \n",
+ " 9.5 | \n",
+ " 0.427 | \n",
+ " 1.4 | \n",
+ " ... | \n",
+ " 1.6 | \n",
+ " 5.3 | \n",
+ " 7.0 | \n",
+ " 2.3 | \n",
+ " 1.5 | \n",
+ " 0.6 | \n",
+ " 2.3 | \n",
+ " 3.4 | \n",
+ " 11.4 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | 3 | \n",
+ " 2011 | \n",
+ " /euro/teams/valencia/2011.html | \n",
+ " EuroLeague | \n",
+ " 14.0 | \n",
+ " NaN | \n",
+ " 386.0 | \n",
+ " 4.8 | \n",
+ " 10.1 | \n",
+ " 0.472 | \n",
+ " 1.3 | \n",
+ " ... | \n",
+ " 1.2 | \n",
+ " 5.1 | \n",
+ " 6.3 | \n",
+ " 1.8 | \n",
+ " 1.9 | \n",
+ " 0.5 | \n",
+ " 3.3 | \n",
+ " 3.3 | \n",
+ " 14.3 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | 4 | \n",
+ " 2012 | \n",
+ " /euro/teams/valencia/2012.html | \n",
+ " EuroCup | \n",
+ " 10.0 | \n",
+ " NaN | \n",
+ " 273.0 | \n",
+ " 4.1 | \n",
+ " 10.2 | \n",
+ " 0.403 | \n",
+ " 1.6 | \n",
+ " ... | \n",
+ " 1.6 | \n",
+ " 3.3 | \n",
+ " 4.9 | \n",
+ " 1.7 | \n",
+ " 2.0 | \n",
+ " 0.3 | \n",
+ " 2.4 | \n",
+ " 4.0 | \n",
+ " 12.4 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
5 rows × 28 columns
\n",
+ "
"
+ ],
+ "text/plain": [
+ " season team_name_season lg_name g gs mp \\\n",
+ "0 2008 /euro/teams/valencia/2008.html ULEB Cup 14.0 NaN 232.0 \n",
+ "1 2009 /euro/teams/valencia/2009.html EuroCup 4.0 NaN 63.0 \n",
+ "2 2010 /euro/teams/valencia/2010.html EuroCup 16.0 NaN 418.0 \n",
+ "3 2011 /euro/teams/valencia/2011.html EuroLeague 14.0 NaN 386.0 \n",
+ "4 2012 /euro/teams/valencia/2012.html EuroCup 10.0 NaN 273.0 \n",
+ "\n",
+ " fg_per_mp fga_per_mp fg_pct fg3_per_mp ... orb_per_mp \\\n",
+ "0 3.9 8.7 0.446 1.2 ... 0.9 \n",
+ "1 2.9 6.3 0.455 0.0 ... 0.0 \n",
+ "2 4.0 9.5 0.427 1.4 ... 1.6 \n",
+ "3 4.8 10.1 0.472 1.3 ... 1.2 \n",
+ "4 4.1 10.2 0.403 1.6 ... 1.6 \n",
+ "\n",
+ " drb_per_mp trb_per_mp ast_per_mp stl_per_mp blk_per_mp tov_per_mp \\\n",
+ "0 4.5 5.4 1.4 2.0 1.2 2.8 \n",
+ "1 5.7 5.7 3.4 0.0 1.7 2.3 \n",
+ "2 5.3 7.0 2.3 1.5 0.6 2.3 \n",
+ "3 5.1 6.3 1.8 1.9 0.5 3.3 \n",
+ "4 3.3 4.9 1.7 2.0 0.3 2.4 \n",
+ "\n",
+ " pf_per_mp pts_per_mp is_playoffs \n",
+ "0 2.9 9.5 True \n",
+ "1 2.9 5.7 True \n",
+ "2 3.4 11.4 True \n",
+ "3 3.3 14.3 True \n",
+ "4 4.0 12.4 True \n",
+ "\n",
+ "[5 rows x 28 columns]"
+ ]
+ },
+ "execution_count": 53,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "player.stats_per36(kind='P', level='E').head()"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 3",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.6.3"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}
diff --git a/test_notebooks/euro/euro_season_test.ipynb b/test_notebooks/euro/euro_season_test.ipynb
new file mode 100644
index 0000000..abd08ab
--- /dev/null
+++ b/test_notebooks/euro/euro_season_test.ipynb
@@ -0,0 +1,1255 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# euro.Season test notebook"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 24,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "from sportsref import euro"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Need league_id to initialize - list of league_ids can be obtained with euro.LEAGUE_IDS"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 33,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "['greek-basket-league', 'eurocup', 'spain-liga-acb', 'italy-basket-serie-a', 'france-lnb-pro-a', 'euroleague']\n"
+ ]
+ }
+ ],
+ "source": [
+ "print(euro.LEAGUE_IDS)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 34,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": [
+ "season = euro.Season(2017, 'france-lnb-pro-a', )"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Helper methods"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 25,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "['chalon', 'strasbourg', 'villeurbanne', 'monaco', 'paris-levallois', 'nanterre', 'gravelines', 'chalons-en-champagne', 'limoges', 'nancy', 'cholet', 'dijon', 'orleans', 'le-mans', 'pau-orthez', 'le-portel', 'hyeres-toulon', 'antibes']\n"
+ ]
+ }
+ ],
+ "source": [
+ "print(season.get_team_ids())"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 26,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "{'chalon': 'Chalon/Saone', 'strasbourg': 'Strasbourg', 'villeurbanne': 'Lyon-Villeurbanne', 'monaco': 'Monaco', 'paris-levallois': 'Paris-Levallois', 'nanterre': 'Nanterre', 'gravelines': 'Gravelines-Dunkerque', 'chalons-en-champagne': 'Chalons-Reims', 'limoges': 'Limoges', 'nancy': 'Nancy', 'cholet': 'Cholet', 'dijon': 'Dijon', 'orleans': 'Orleans', 'le-mans': 'Le Mans', 'pau-orthez': 'Pau-Lacq-Orthez', 'le-portel': 'Le Portel', 'hyeres-toulon': 'Hyeres-Toulon', 'antibes': 'Antibes'}\n"
+ ]
+ }
+ ],
+ "source": [
+ "print(season.team_ids_to_names())"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 27,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "{'Chalon/Saone': 'chalon', 'Strasbourg': 'strasbourg', 'Lyon-Villeurbanne': 'villeurbanne', 'Monaco': 'monaco', 'Paris-Levallois': 'paris-levallois', 'Nanterre': 'nanterre', 'Gravelines-Dunkerque': 'gravelines', 'Chalons-Reims': 'chalons-en-champagne', 'Limoges': 'limoges', 'Nancy': 'nancy', 'Cholet': 'cholet', 'Dijon': 'dijon', 'Orleans': 'orleans', 'Le Mans': 'le-mans', 'Pau-Lacq-Orthez': 'pau-orthez', 'Le Portel': 'le-portel', 'Hyeres-Toulon': 'hyeres-toulon', 'Antibes': 'antibes'}\n"
+ ]
+ }
+ ],
+ "source": [
+ "print(season.team_names_to_ids())"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Schedule\n",
+ "\n",
+ "### takes kind argument: \n",
+ "#### R (Club play)\n",
+ "#### P (Euroleague play)\n",
+ "#### B (both)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 28,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "347\n",
+ "24\n",
+ "323\n"
+ ]
+ }
+ ],
+ "source": [
+ "print(len(season.schedule(kind='B')))\n",
+ "print(len(season.schedule(kind='P')))\n",
+ "print(len(season.schedule(kind='R')))"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 29,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " boxscore_id | \n",
+ " visitor_team_name | \n",
+ " visitor_pts | \n",
+ " home_team_name | \n",
+ " home_pts | \n",
+ " boxscore_id | \n",
+ " overtimes | \n",
+ " notes | \n",
+ " is_playoffs | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " | 0 | \n",
+ " 2016-09-23-hyeres-toulon | \n",
+ " Gravelines-Dunkerque | \n",
+ " 62.0 | \n",
+ " Hyeres-Toulon | \n",
+ " 75.0 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 1 | \n",
+ " 2016-09-23-le-portel | \n",
+ " Nanterre | \n",
+ " 84.0 | \n",
+ " Le Portel | \n",
+ " 65.0 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 2 | \n",
+ " 2016-09-23-paris-levallois | \n",
+ " Nancy | \n",
+ " 67.0 | \n",
+ " Paris-Levallois | \n",
+ " 75.0 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 3 | \n",
+ " 2016-09-24-chalon | \n",
+ " Orleans | \n",
+ " 67.0 | \n",
+ " Chalon/Saone | \n",
+ " 87.0 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 4 | \n",
+ " 2016-09-24-chalons-en-champagne | \n",
+ " Antibes | \n",
+ " 92.0 | \n",
+ " Chalons-Reims | \n",
+ " 77.0 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ " boxscore_id visitor_team_name visitor_pts \\\n",
+ "0 2016-09-23-hyeres-toulon Gravelines-Dunkerque 62.0 \n",
+ "1 2016-09-23-le-portel Nanterre 84.0 \n",
+ "2 2016-09-23-paris-levallois Nancy 67.0 \n",
+ "3 2016-09-24-chalon Orleans 67.0 \n",
+ "4 2016-09-24-chalons-en-champagne Antibes 92.0 \n",
+ "\n",
+ " home_team_name home_pts boxscore_id overtimes notes is_playoffs \n",
+ "0 Hyeres-Toulon 75.0 NaN NaN NaN False \n",
+ "1 Le Portel 65.0 NaN NaN NaN False \n",
+ "2 Paris-Levallois 75.0 NaN NaN NaN False \n",
+ "3 Chalon/Saone 87.0 NaN NaN NaN False \n",
+ "4 Chalons-Reims 77.0 NaN NaN NaN False "
+ ]
+ },
+ "execution_count": 29,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "season.schedule(kind='B').head()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 30,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " boxscore_id | \n",
+ " visitor_team_name | \n",
+ " visitor_pts | \n",
+ " home_team_name | \n",
+ " home_pts | \n",
+ " boxscore_id | \n",
+ " overtimes | \n",
+ " notes | \n",
+ " is_playoffs | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " | 0 | \n",
+ " 2017-05-22-monaco | \n",
+ " Lyon-Villeurbanne | \n",
+ " 72.0 | \n",
+ " Monaco | \n",
+ " 69.0 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | 1 | \n",
+ " 2017-05-22-strasbourg | \n",
+ " Pau-Lacq-Orthez | \n",
+ " 102.0 | \n",
+ " Strasbourg | \n",
+ " 92.0 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | 2 | \n",
+ " 2017-05-23-chalon | \n",
+ " Le Portel | \n",
+ " 63.0 | \n",
+ " Chalon/Saone | \n",
+ " 76.0 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | 3 | \n",
+ " 2017-05-23-nanterre | \n",
+ " Paris-Levallois | \n",
+ " 88.0 | \n",
+ " Nanterre | \n",
+ " 85.0 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | 4 | \n",
+ " 2017-05-24-pau-orthez | \n",
+ " Strasbourg | \n",
+ " 83.0 | \n",
+ " Pau-Lacq-Orthez | \n",
+ " 68.0 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ " boxscore_id visitor_team_name visitor_pts home_team_name \\\n",
+ "0 2017-05-22-monaco Lyon-Villeurbanne 72.0 Monaco \n",
+ "1 2017-05-22-strasbourg Pau-Lacq-Orthez 102.0 Strasbourg \n",
+ "2 2017-05-23-chalon Le Portel 63.0 Chalon/Saone \n",
+ "3 2017-05-23-nanterre Paris-Levallois 88.0 Nanterre \n",
+ "4 2017-05-24-pau-orthez Strasbourg 83.0 Pau-Lacq-Orthez \n",
+ "\n",
+ " home_pts boxscore_id overtimes notes is_playoffs \n",
+ "0 69.0 NaN NaN NaN True \n",
+ "1 92.0 NaN NaN NaN True \n",
+ "2 76.0 NaN NaN NaN True \n",
+ "3 85.0 NaN NaN NaN True \n",
+ "4 68.0 NaN NaN NaN True "
+ ]
+ },
+ "execution_count": 30,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "season.schedule(kind='P').head()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 31,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " boxscore_id | \n",
+ " visitor_team_name | \n",
+ " visitor_pts | \n",
+ " home_team_name | \n",
+ " home_pts | \n",
+ " boxscore_id | \n",
+ " overtimes | \n",
+ " notes | \n",
+ " is_playoffs | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " | 0 | \n",
+ " 2016-09-23-hyeres-toulon | \n",
+ " Gravelines-Dunkerque | \n",
+ " 62.0 | \n",
+ " Hyeres-Toulon | \n",
+ " 75.0 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 1 | \n",
+ " 2016-09-23-le-portel | \n",
+ " Nanterre | \n",
+ " 84.0 | \n",
+ " Le Portel | \n",
+ " 65.0 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 2 | \n",
+ " 2016-09-23-paris-levallois | \n",
+ " Nancy | \n",
+ " 67.0 | \n",
+ " Paris-Levallois | \n",
+ " 75.0 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 3 | \n",
+ " 2016-09-24-chalon | \n",
+ " Orleans | \n",
+ " 67.0 | \n",
+ " Chalon/Saone | \n",
+ " 87.0 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 4 | \n",
+ " 2016-09-24-chalons-en-champagne | \n",
+ " Antibes | \n",
+ " 92.0 | \n",
+ " Chalons-Reims | \n",
+ " 77.0 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ " boxscore_id visitor_team_name visitor_pts \\\n",
+ "0 2016-09-23-hyeres-toulon Gravelines-Dunkerque 62.0 \n",
+ "1 2016-09-23-le-portel Nanterre 84.0 \n",
+ "2 2016-09-23-paris-levallois Nancy 67.0 \n",
+ "3 2016-09-24-chalon Orleans 67.0 \n",
+ "4 2016-09-24-chalons-en-champagne Antibes 92.0 \n",
+ "\n",
+ " home_team_name home_pts boxscore_id overtimes notes is_playoffs \n",
+ "0 Hyeres-Toulon 75.0 NaN NaN NaN False \n",
+ "1 Le Portel 65.0 NaN NaN NaN False \n",
+ "2 Paris-Levallois 75.0 NaN NaN NaN False \n",
+ "3 Chalon/Saone 87.0 NaN NaN NaN False \n",
+ "4 Chalons-Reims 77.0 NaN NaN NaN False "
+ ]
+ },
+ "execution_count": 31,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "season.schedule(kind='R').head()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Standings (no args)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 22,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " wins | \n",
+ " losses | \n",
+ " win_loss_pct | \n",
+ " gb | \n",
+ " pts_per_g | \n",
+ " opp_pts_per_g | \n",
+ " wins_pyth | \n",
+ " losses_pyth | \n",
+ " | \n",
+ " wins_playoffs | \n",
+ " losses_playoffs | \n",
+ " win_loss_pct_playoffs | \n",
+ " pts_per_g_playoffs | \n",
+ " opp_pts_per_g_playoffs | \n",
+ " wins_pyth_playoffs | \n",
+ " losses_pyth_playoffs | \n",
+ " has_class_full_table | \n",
+ "
\n",
+ " \n",
+ " | team_id | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " | monaco | \n",
+ " 30.0 | \n",
+ " 4.0 | \n",
+ " 0.882 | \n",
+ " — | \n",
+ " 90.6 | \n",
+ " 79.9 | \n",
+ " 29.0 | \n",
+ " 5.0 | \n",
+ " NaN | \n",
+ " 1.0 | \n",
+ " 2.0 | \n",
+ " 0.333 | \n",
+ " 70.3 | \n",
+ " 70.7 | \n",
+ " 1.0 | \n",
+ " 2.0 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | chalon | \n",
+ " 27.0 | \n",
+ " 7.0 | \n",
+ " 0.794 | \n",
+ " 3 | \n",
+ " 109.6 | \n",
+ " 99.5 | \n",
+ " 27.0 | \n",
+ " 7.0 | \n",
+ " NaN | \n",
+ " 8.0 | \n",
+ " 3.0 | \n",
+ " 0.727 | \n",
+ " 77.7 | \n",
+ " 72.0 | \n",
+ " 8.0 | \n",
+ " 3.0 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | nanterre | \n",
+ " 25.0 | \n",
+ " 9.0 | \n",
+ " 0.735 | \n",
+ " 5 | \n",
+ " 85.9 | \n",
+ " 80.7 | \n",
+ " 24.0 | \n",
+ " 10.0 | \n",
+ " NaN | \n",
+ " 0.0 | \n",
+ " 2.0 | \n",
+ " 0.000 | \n",
+ " 78.0 | \n",
+ " 82.5 | \n",
+ " 1.0 | \n",
+ " 1.0 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | strasbourg | \n",
+ " 23.0 | \n",
+ " 11.0 | \n",
+ " 0.676 | \n",
+ " 7 | \n",
+ " 107.5 | \n",
+ " 101.0 | \n",
+ " 24.0 | \n",
+ " 10.0 | \n",
+ " NaN | \n",
+ " 7.0 | \n",
+ " 6.0 | \n",
+ " 0.538 | \n",
+ " 74.2 | \n",
+ " 74.4 | \n",
+ " 6.0 | \n",
+ " 7.0 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | pau-orthez | \n",
+ " 21.0 | \n",
+ " 12.0 | \n",
+ " 0.636 | \n",
+ " 8.5 | \n",
+ " 85.5 | \n",
+ " 82.0 | \n",
+ " 21.0 | \n",
+ " 12.0 | \n",
+ " NaN | \n",
+ " 1.0 | \n",
+ " 2.0 | \n",
+ " 0.333 | \n",
+ " 79.3 | \n",
+ " 82.3 | \n",
+ " 1.0 | \n",
+ " 2.0 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ " wins losses win_loss_pct gb pts_per_g opp_pts_per_g \\\n",
+ "team_id \n",
+ "monaco 30.0 4.0 0.882 — 90.6 79.9 \n",
+ "chalon 27.0 7.0 0.794 3 109.6 99.5 \n",
+ "nanterre 25.0 9.0 0.735 5 85.9 80.7 \n",
+ "strasbourg 23.0 11.0 0.676 7 107.5 101.0 \n",
+ "pau-orthez 21.0 12.0 0.636 8.5 85.5 82.0 \n",
+ "\n",
+ " wins_pyth losses_pyth wins_playoffs losses_playoffs \\\n",
+ "team_id \n",
+ "monaco 29.0 5.0 NaN 1.0 2.0 \n",
+ "chalon 27.0 7.0 NaN 8.0 3.0 \n",
+ "nanterre 24.0 10.0 NaN 0.0 2.0 \n",
+ "strasbourg 24.0 10.0 NaN 7.0 6.0 \n",
+ "pau-orthez 21.0 12.0 NaN 1.0 2.0 \n",
+ "\n",
+ " win_loss_pct_playoffs pts_per_g_playoffs opp_pts_per_g_playoffs \\\n",
+ "team_id \n",
+ "monaco 0.333 70.3 70.7 \n",
+ "chalon 0.727 77.7 72.0 \n",
+ "nanterre 0.000 78.0 82.5 \n",
+ "strasbourg 0.538 74.2 74.4 \n",
+ "pau-orthez 0.333 79.3 82.3 \n",
+ "\n",
+ " wins_pyth_playoffs losses_pyth_playoffs has_class_full_table \n",
+ "team_id \n",
+ "monaco 1.0 2.0 True \n",
+ "chalon 8.0 3.0 True \n",
+ "nanterre 1.0 1.0 True \n",
+ "strasbourg 6.0 7.0 True \n",
+ "pau-orthez 1.0 2.0 True "
+ ]
+ },
+ "execution_count": 22,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "season.standings().head()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## team stat tables (no args)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 23,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " g | \n",
+ " fg | \n",
+ " fga | \n",
+ " fg_pct | \n",
+ " fg3 | \n",
+ " fg3a | \n",
+ " fg3_pct | \n",
+ " fg2 | \n",
+ " fg2a | \n",
+ " fg2_pct | \n",
+ " ... | \n",
+ " ft_pct | \n",
+ " orb | \n",
+ " drb | \n",
+ " trb | \n",
+ " ast | \n",
+ " stl | \n",
+ " blk | \n",
+ " tov | \n",
+ " pf | \n",
+ " pts | \n",
+ "
\n",
+ " \n",
+ " | team_id | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " | chalon | \n",
+ " 34.0 | \n",
+ " 1381.0 | \n",
+ " 2770.0 | \n",
+ " 0.499 | \n",
+ " 357.0 | \n",
+ " 968.0 | \n",
+ " 0.369 | \n",
+ " 1024.0 | \n",
+ " 1802.0 | \n",
+ " 0.568 | \n",
+ " ... | \n",
+ " 0.706 | \n",
+ " 378.0 | \n",
+ " 1117.0 | \n",
+ " 1495.0 | \n",
+ " 819.0 | \n",
+ " 240.0 | \n",
+ " 159.0 | \n",
+ " 512.0 | \n",
+ " 738.0 | \n",
+ " 3726.0 | \n",
+ "
\n",
+ " \n",
+ " | strasbourg | \n",
+ " 34.0 | \n",
+ " 1335.0 | \n",
+ " 2900.0 | \n",
+ " 0.460 | \n",
+ " 365.0 | \n",
+ " 969.0 | \n",
+ " 0.377 | \n",
+ " 970.0 | \n",
+ " 1931.0 | \n",
+ " 0.502 | \n",
+ " ... | \n",
+ " 0.704 | \n",
+ " 461.0 | \n",
+ " 1096.0 | \n",
+ " 1557.0 | \n",
+ " 894.0 | \n",
+ " 329.0 | \n",
+ " 123.0 | \n",
+ " 584.0 | \n",
+ " 977.0 | \n",
+ " 3654.0 | \n",
+ "
\n",
+ " \n",
+ " | villeurbanne | \n",
+ " 34.0 | \n",
+ " 1107.0 | \n",
+ " 2437.0 | \n",
+ " 0.454 | \n",
+ " 299.0 | \n",
+ " 868.0 | \n",
+ " 0.344 | \n",
+ " 808.0 | \n",
+ " 1569.0 | \n",
+ " 0.515 | \n",
+ " ... | \n",
+ " 0.747 | \n",
+ " 340.0 | \n",
+ " 1003.0 | \n",
+ " 1343.0 | \n",
+ " 733.0 | \n",
+ " 259.0 | \n",
+ " 122.0 | \n",
+ " 559.0 | \n",
+ " 835.0 | \n",
+ " 3107.0 | \n",
+ "
\n",
+ " \n",
+ " | monaco | \n",
+ " 34.0 | \n",
+ " 1107.0 | \n",
+ " 2417.0 | \n",
+ " 0.458 | \n",
+ " 306.0 | \n",
+ " 861.0 | \n",
+ " 0.355 | \n",
+ " 801.0 | \n",
+ " 1556.0 | \n",
+ " 0.515 | \n",
+ " ... | \n",
+ " 0.742 | \n",
+ " 439.0 | \n",
+ " 819.0 | \n",
+ " 1258.0 | \n",
+ " 693.0 | \n",
+ " 326.0 | \n",
+ " 130.0 | \n",
+ " 448.0 | \n",
+ " 806.0 | \n",
+ " 3080.0 | \n",
+ "
\n",
+ " \n",
+ " | paris-levallois | \n",
+ " 34.0 | \n",
+ " 1142.0 | \n",
+ " 2524.0 | \n",
+ " 0.452 | \n",
+ " 252.0 | \n",
+ " 768.0 | \n",
+ " 0.328 | \n",
+ " 890.0 | \n",
+ " 1756.0 | \n",
+ " 0.507 | \n",
+ " ... | \n",
+ " 0.696 | \n",
+ " 426.0 | \n",
+ " 979.0 | \n",
+ " 1405.0 | \n",
+ " 642.0 | \n",
+ " 245.0 | \n",
+ " 109.0 | \n",
+ " 506.0 | \n",
+ " 844.0 | \n",
+ " 3061.0 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
5 rows × 22 columns
\n",
+ "
"
+ ],
+ "text/plain": [
+ " g fg fga fg_pct fg3 fg3a fg3_pct fg2 \\\n",
+ "team_id \n",
+ "chalon 34.0 1381.0 2770.0 0.499 357.0 968.0 0.369 1024.0 \n",
+ "strasbourg 34.0 1335.0 2900.0 0.460 365.0 969.0 0.377 970.0 \n",
+ "villeurbanne 34.0 1107.0 2437.0 0.454 299.0 868.0 0.344 808.0 \n",
+ "monaco 34.0 1107.0 2417.0 0.458 306.0 861.0 0.355 801.0 \n",
+ "paris-levallois 34.0 1142.0 2524.0 0.452 252.0 768.0 0.328 890.0 \n",
+ "\n",
+ " fg2a fg2_pct ... ft_pct orb drb trb \\\n",
+ "team_id ... \n",
+ "chalon 1802.0 0.568 ... 0.706 378.0 1117.0 1495.0 \n",
+ "strasbourg 1931.0 0.502 ... 0.704 461.0 1096.0 1557.0 \n",
+ "villeurbanne 1569.0 0.515 ... 0.747 340.0 1003.0 1343.0 \n",
+ "monaco 1556.0 0.515 ... 0.742 439.0 819.0 1258.0 \n",
+ "paris-levallois 1756.0 0.507 ... 0.696 426.0 979.0 1405.0 \n",
+ "\n",
+ " ast stl blk tov pf pts \n",
+ "team_id \n",
+ "chalon 819.0 240.0 159.0 512.0 738.0 3726.0 \n",
+ "strasbourg 894.0 329.0 123.0 584.0 977.0 3654.0 \n",
+ "villeurbanne 733.0 259.0 122.0 559.0 835.0 3107.0 \n",
+ "monaco 693.0 326.0 130.0 448.0 806.0 3080.0 \n",
+ "paris-levallois 642.0 245.0 109.0 506.0 844.0 3061.0 \n",
+ "\n",
+ "[5 rows x 22 columns]"
+ ]
+ },
+ "execution_count": 23,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "season.team_stats_totals().head()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 32,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " g | \n",
+ " fg_per_g | \n",
+ " fga_per_g | \n",
+ " fg_pct | \n",
+ " fg3_per_g | \n",
+ " fg3a_per_g | \n",
+ " fg3_pct | \n",
+ " fg2_per_g | \n",
+ " fg2a_per_g | \n",
+ " fg2_pct | \n",
+ " ... | \n",
+ " ft_pct | \n",
+ " orb_per_g | \n",
+ " drb_per_g | \n",
+ " trb_per_g | \n",
+ " ast_per_g | \n",
+ " stl_per_g | \n",
+ " blk_per_g | \n",
+ " tov_per_g | \n",
+ " pf_per_g | \n",
+ " pts_per_g | \n",
+ "
\n",
+ " \n",
+ " | team_id | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " | chalon | \n",
+ " 34.0 | \n",
+ " 40.6 | \n",
+ " 81.5 | \n",
+ " 0.499 | \n",
+ " 10.5 | \n",
+ " 28.5 | \n",
+ " 0.369 | \n",
+ " 30.1 | \n",
+ " 53.0 | \n",
+ " 0.568 | \n",
+ " ... | \n",
+ " 0.706 | \n",
+ " 11.1 | \n",
+ " 32.9 | \n",
+ " 44.0 | \n",
+ " 24.1 | \n",
+ " 7.1 | \n",
+ " 4.7 | \n",
+ " 15.1 | \n",
+ " 21.7 | \n",
+ " 109.6 | \n",
+ "
\n",
+ " \n",
+ " | strasbourg | \n",
+ " 34.0 | \n",
+ " 39.3 | \n",
+ " 85.3 | \n",
+ " 0.460 | \n",
+ " 10.7 | \n",
+ " 28.5 | \n",
+ " 0.377 | \n",
+ " 28.5 | \n",
+ " 56.8 | \n",
+ " 0.502 | \n",
+ " ... | \n",
+ " 0.704 | \n",
+ " 13.6 | \n",
+ " 32.2 | \n",
+ " 45.8 | \n",
+ " 26.3 | \n",
+ " 9.7 | \n",
+ " 3.6 | \n",
+ " 17.2 | \n",
+ " 28.7 | \n",
+ " 107.5 | \n",
+ "
\n",
+ " \n",
+ " | villeurbanne | \n",
+ " 34.0 | \n",
+ " 32.6 | \n",
+ " 71.7 | \n",
+ " 0.454 | \n",
+ " 8.8 | \n",
+ " 25.5 | \n",
+ " 0.344 | \n",
+ " 23.8 | \n",
+ " 46.1 | \n",
+ " 0.515 | \n",
+ " ... | \n",
+ " 0.747 | \n",
+ " 10.0 | \n",
+ " 29.5 | \n",
+ " 39.5 | \n",
+ " 21.6 | \n",
+ " 7.6 | \n",
+ " 3.6 | \n",
+ " 16.4 | \n",
+ " 24.6 | \n",
+ " 91.4 | \n",
+ "
\n",
+ " \n",
+ " | monaco | \n",
+ " 34.0 | \n",
+ " 32.6 | \n",
+ " 71.1 | \n",
+ " 0.458 | \n",
+ " 9.0 | \n",
+ " 25.3 | \n",
+ " 0.355 | \n",
+ " 23.6 | \n",
+ " 45.8 | \n",
+ " 0.515 | \n",
+ " ... | \n",
+ " 0.742 | \n",
+ " 12.9 | \n",
+ " 24.1 | \n",
+ " 37.0 | \n",
+ " 20.4 | \n",
+ " 9.6 | \n",
+ " 3.8 | \n",
+ " 13.2 | \n",
+ " 23.7 | \n",
+ " 90.6 | \n",
+ "
\n",
+ " \n",
+ " | paris-levallois | \n",
+ " 34.0 | \n",
+ " 33.6 | \n",
+ " 74.2 | \n",
+ " 0.452 | \n",
+ " 7.4 | \n",
+ " 22.6 | \n",
+ " 0.328 | \n",
+ " 26.2 | \n",
+ " 51.6 | \n",
+ " 0.507 | \n",
+ " ... | \n",
+ " 0.696 | \n",
+ " 12.5 | \n",
+ " 28.8 | \n",
+ " 41.3 | \n",
+ " 18.9 | \n",
+ " 7.2 | \n",
+ " 3.2 | \n",
+ " 14.9 | \n",
+ " 24.8 | \n",
+ " 90.0 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
5 rows × 22 columns
\n",
+ "
"
+ ],
+ "text/plain": [
+ " g fg_per_g fga_per_g fg_pct fg3_per_g fg3a_per_g \\\n",
+ "team_id \n",
+ "chalon 34.0 40.6 81.5 0.499 10.5 28.5 \n",
+ "strasbourg 34.0 39.3 85.3 0.460 10.7 28.5 \n",
+ "villeurbanne 34.0 32.6 71.7 0.454 8.8 25.5 \n",
+ "monaco 34.0 32.6 71.1 0.458 9.0 25.3 \n",
+ "paris-levallois 34.0 33.6 74.2 0.452 7.4 22.6 \n",
+ "\n",
+ " fg3_pct fg2_per_g fg2a_per_g fg2_pct ... ft_pct \\\n",
+ "team_id ... \n",
+ "chalon 0.369 30.1 53.0 0.568 ... 0.706 \n",
+ "strasbourg 0.377 28.5 56.8 0.502 ... 0.704 \n",
+ "villeurbanne 0.344 23.8 46.1 0.515 ... 0.747 \n",
+ "monaco 0.355 23.6 45.8 0.515 ... 0.742 \n",
+ "paris-levallois 0.328 26.2 51.6 0.507 ... 0.696 \n",
+ "\n",
+ " orb_per_g drb_per_g trb_per_g ast_per_g stl_per_g \\\n",
+ "team_id \n",
+ "chalon 11.1 32.9 44.0 24.1 7.1 \n",
+ "strasbourg 13.6 32.2 45.8 26.3 9.7 \n",
+ "villeurbanne 10.0 29.5 39.5 21.6 7.6 \n",
+ "monaco 12.9 24.1 37.0 20.4 9.6 \n",
+ "paris-levallois 12.5 28.8 41.3 18.9 7.2 \n",
+ "\n",
+ " blk_per_g tov_per_g pf_per_g pts_per_g \n",
+ "team_id \n",
+ "chalon 4.7 15.1 21.7 109.6 \n",
+ "strasbourg 3.6 17.2 28.7 107.5 \n",
+ "villeurbanne 3.6 16.4 24.6 91.4 \n",
+ "monaco 3.8 13.2 23.7 90.6 \n",
+ "paris-levallois 3.2 14.9 24.8 90.0 \n",
+ "\n",
+ "[5 rows x 22 columns]"
+ ]
+ },
+ "execution_count": 32,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "season.team_stats_per_game().head()"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 3",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.6.3"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}
diff --git a/test_notebooks/euro/euro_team_test.ipynb b/test_notebooks/euro/euro_team_test.ipynb
new file mode 100644
index 0000000..7848cba
--- /dev/null
+++ b/test_notebooks/euro/euro_team_test.ipynb
@@ -0,0 +1,1759 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# euro.Team test"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "scrolled": true
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Regenerating PSFConstants file\n",
+ "Regenerating GPFConstants file\n"
+ ]
+ }
+ ],
+ "source": [
+ "from sportsref import euro"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": [
+ "team = euro.Team('barcelona')"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Helper methods"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "spain-liga-acb\n",
+ "FC Barcelona\n"
+ ]
+ }
+ ],
+ "source": [
+ "print(team.get_league_id())\n",
+ "print(team.name())"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Tables are slightly different than player - because there is no playoff/reg season separate tables (just different pages distinguishing level of competition), no kind param, just level (no concatenation w kind_rpb needed) \n",
+ "\n",
+ "## In general, used kind when concatenation made sense, and level when it didn't (needed 2 different params because in player, both needed)\n",
+ "\n",
+ "### See https://www.basketball-reference.com/euro/teams/barcelona/2017_euroleague.html\n",
+ "\n",
+ "### 'E' = Euroleague\n",
+ "### 'C' = Club play\n",
+ "### 'B' = both (combined in 1 table, not concatenated together like playoff/reg season tables)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## all team and opp stats table:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "scrolled": false
+ },
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " team_id | \n",
+ " g | \n",
+ " mp | \n",
+ " fg | \n",
+ " fga | \n",
+ " fg_pct | \n",
+ " fg3 | \n",
+ " fg3a | \n",
+ " fg3_pct | \n",
+ " fg2 | \n",
+ " ... | \n",
+ " ft_pct | \n",
+ " orb | \n",
+ " drb | \n",
+ " trb | \n",
+ " ast | \n",
+ " stl | \n",
+ " blk | \n",
+ " tov | \n",
+ " pf | \n",
+ " pts | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " | 0 | \n",
+ " Team | \n",
+ " 62.0 | \n",
+ " 13100.0 | \n",
+ " 1795.0 | \n",
+ " 3812.0 | \n",
+ " 0.471 | \n",
+ " 586.0 | \n",
+ " 1579.0 | \n",
+ " 0.371 | \n",
+ " 1209.0 | \n",
+ " ... | \n",
+ " 0.744 | \n",
+ " 515.0 | \n",
+ " 1510.0 | \n",
+ " 2025.0 | \n",
+ " 1084.0 | \n",
+ " 437.0 | \n",
+ " 140.0 | \n",
+ " 884.0 | \n",
+ " 1313.0 | \n",
+ " 4988.0 | \n",
+ "
\n",
+ " \n",
+ " | 1 | \n",
+ " Opponent | \n",
+ " 62.0 | \n",
+ " 13100.0 | \n",
+ " 1754.0 | \n",
+ " 4013.0 | \n",
+ " 0.437 | \n",
+ " 584.0 | \n",
+ " 1623.0 | \n",
+ " 0.360 | \n",
+ " 1170.0 | \n",
+ " ... | \n",
+ " 0.763 | \n",
+ " 573.0 | \n",
+ " 1368.0 | \n",
+ " 1941.0 | \n",
+ " 1039.0 | \n",
+ " 453.0 | \n",
+ " 109.0 | \n",
+ " 779.0 | \n",
+ " 1318.0 | \n",
+ " 4897.0 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
2 rows × 24 columns
\n",
+ "
"
+ ],
+ "text/plain": [
+ " team_id g mp fg fga fg_pct fg3 fg3a fg3_pct \\\n",
+ "0 Team 62.0 13100.0 1795.0 3812.0 0.471 586.0 1579.0 0.371 \n",
+ "1 Opponent 62.0 13100.0 1754.0 4013.0 0.437 584.0 1623.0 0.360 \n",
+ "\n",
+ " fg2 ... ft_pct orb drb trb ast stl blk tov \\\n",
+ "0 1209.0 ... 0.744 515.0 1510.0 2025.0 1084.0 437.0 140.0 884.0 \n",
+ "1 1170.0 ... 0.763 573.0 1368.0 1941.0 1039.0 453.0 109.0 779.0 \n",
+ "\n",
+ " pf pts \n",
+ "0 1313.0 4988.0 \n",
+ "1 1318.0 4897.0 \n",
+ "\n",
+ "[2 rows x 24 columns]"
+ ]
+ },
+ "execution_count": 4,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "team.all_team_opp_stats(2017, level='B').head()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " team_id | \n",
+ " g | \n",
+ " mp | \n",
+ " fg | \n",
+ " fga | \n",
+ " fg_pct | \n",
+ " fg3 | \n",
+ " fg3a | \n",
+ " fg3_pct | \n",
+ " fg2 | \n",
+ " ... | \n",
+ " ft_pct | \n",
+ " orb | \n",
+ " drb | \n",
+ " trb | \n",
+ " ast | \n",
+ " stl | \n",
+ " blk | \n",
+ " tov | \n",
+ " pf | \n",
+ " pts | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " | 0 | \n",
+ " Team | \n",
+ " 30.0 | \n",
+ " 6025.0 | \n",
+ " 767.0 | \n",
+ " 1739.0 | \n",
+ " 0.441 | \n",
+ " 271.0 | \n",
+ " 716.0 | \n",
+ " 0.378 | \n",
+ " 496.0 | \n",
+ " ... | \n",
+ " 0.737 | \n",
+ " 245.0 | \n",
+ " 680.0 | \n",
+ " 925.0 | \n",
+ " 517.0 | \n",
+ " 212.0 | \n",
+ " 61.0 | \n",
+ " 420.0 | \n",
+ " 553.0 | \n",
+ " 2141.0 | \n",
+ "
\n",
+ " \n",
+ " | 1 | \n",
+ " Opponent | \n",
+ " 30.0 | \n",
+ " 6025.0 | \n",
+ " 834.0 | \n",
+ " 1844.0 | \n",
+ " 0.452 | \n",
+ " 263.0 | \n",
+ " 729.0 | \n",
+ " 0.361 | \n",
+ " 571.0 | \n",
+ " ... | \n",
+ " 0.748 | \n",
+ " 254.0 | \n",
+ " 659.0 | \n",
+ " 913.0 | \n",
+ " 510.0 | \n",
+ " 232.0 | \n",
+ " 65.0 | \n",
+ " 357.0 | \n",
+ " 599.0 | \n",
+ " 2242.0 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
2 rows × 24 columns
\n",
+ "
"
+ ],
+ "text/plain": [
+ " team_id g mp fg fga fg_pct fg3 fg3a fg3_pct \\\n",
+ "0 Team 30.0 6025.0 767.0 1739.0 0.441 271.0 716.0 0.378 \n",
+ "1 Opponent 30.0 6025.0 834.0 1844.0 0.452 263.0 729.0 0.361 \n",
+ "\n",
+ " fg2 ... ft_pct orb drb trb ast stl blk tov \\\n",
+ "0 496.0 ... 0.737 245.0 680.0 925.0 517.0 212.0 61.0 420.0 \n",
+ "1 571.0 ... 0.748 254.0 659.0 913.0 510.0 232.0 65.0 357.0 \n",
+ "\n",
+ " pf pts \n",
+ "0 553.0 2141.0 \n",
+ "1 599.0 2242.0 \n",
+ "\n",
+ "[2 rows x 24 columns]"
+ ]
+ },
+ "execution_count": 5,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "team.all_team_opp_stats(2017, level='E').head()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "scrolled": true
+ },
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " team_id | \n",
+ " g | \n",
+ " mp | \n",
+ " fg | \n",
+ " fga | \n",
+ " fg_pct | \n",
+ " fg3 | \n",
+ " fg3a | \n",
+ " fg3_pct | \n",
+ " fg2 | \n",
+ " ... | \n",
+ " ft_pct | \n",
+ " orb | \n",
+ " drb | \n",
+ " trb | \n",
+ " ast | \n",
+ " stl | \n",
+ " blk | \n",
+ " tov | \n",
+ " pf | \n",
+ " pts | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " | 0 | \n",
+ " Team | \n",
+ " 32.0 | \n",
+ " 7075.0 | \n",
+ " 1028.0 | \n",
+ " 2073.0 | \n",
+ " 0.496 | \n",
+ " 315.0 | \n",
+ " 863.0 | \n",
+ " 0.365 | \n",
+ " 713.0 | \n",
+ " ... | \n",
+ " 0.748 | \n",
+ " 270.0 | \n",
+ " 830.0 | \n",
+ " 1100.0 | \n",
+ " 567.0 | \n",
+ " 225.0 | \n",
+ " 79.0 | \n",
+ " 464.0 | \n",
+ " 760.0 | \n",
+ " 2847.0 | \n",
+ "
\n",
+ " \n",
+ " | 1 | \n",
+ " Opponent | \n",
+ " 32.0 | \n",
+ " 7075.0 | \n",
+ " 920.0 | \n",
+ " 2169.0 | \n",
+ " 0.424 | \n",
+ " 321.0 | \n",
+ " 894.0 | \n",
+ " 0.359 | \n",
+ " 599.0 | \n",
+ " ... | \n",
+ " 0.773 | \n",
+ " 319.0 | \n",
+ " 709.0 | \n",
+ " 1028.0 | \n",
+ " 529.0 | \n",
+ " 221.0 | \n",
+ " 44.0 | \n",
+ " 422.0 | \n",
+ " 719.0 | \n",
+ " 2655.0 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
2 rows × 24 columns
\n",
+ "
"
+ ],
+ "text/plain": [
+ " team_id g mp fg fga fg_pct fg3 fg3a fg3_pct \\\n",
+ "0 Team 32.0 7075.0 1028.0 2073.0 0.496 315.0 863.0 0.365 \n",
+ "1 Opponent 32.0 7075.0 920.0 2169.0 0.424 321.0 894.0 0.359 \n",
+ "\n",
+ " fg2 ... ft_pct orb drb trb ast stl blk tov \\\n",
+ "0 713.0 ... 0.748 270.0 830.0 1100.0 567.0 225.0 79.0 464.0 \n",
+ "1 599.0 ... 0.773 319.0 709.0 1028.0 529.0 221.0 44.0 422.0 \n",
+ "\n",
+ " pf pts \n",
+ "0 760.0 2847.0 \n",
+ "1 719.0 2655.0 \n",
+ "\n",
+ "[2 rows x 24 columns]"
+ ]
+ },
+ "execution_count": 6,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "team.all_team_opp_stats(2017, level='C').head()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Other stats tables have same level param"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " player_id | \n",
+ " g | \n",
+ " gs | \n",
+ " mp_per_g | \n",
+ " fg_per_g | \n",
+ " fga_per_g | \n",
+ " fg_pct | \n",
+ " fg3_per_g | \n",
+ " fg3a_per_g | \n",
+ " fg3_pct | \n",
+ " ... | \n",
+ " orb_per_g | \n",
+ " drb_per_g | \n",
+ " trb_per_g | \n",
+ " ast_per_g | \n",
+ " stl_per_g | \n",
+ " blk_per_g | \n",
+ " tov_per_g | \n",
+ " pf_per_g | \n",
+ " pts_per_g | \n",
+ " player_name | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " | 0 | \n",
+ " tyrese-rice-1 | \n",
+ " 61.0 | \n",
+ " NaN | \n",
+ " 27.5 | \n",
+ " 4.2 | \n",
+ " 10.8 | \n",
+ " 0.390 | \n",
+ " 1.6 | \n",
+ " 5.2 | \n",
+ " 0.307 | \n",
+ " ... | \n",
+ " 0.2 | \n",
+ " 1.3 | \n",
+ " 1.6 | \n",
+ " 4.1 | \n",
+ " 1.0 | \n",
+ " 0.1 | \n",
+ " 2.5 | \n",
+ " 2.3 | \n",
+ " 12.3 | \n",
+ " Tyrese Rice | \n",
+ "
\n",
+ " \n",
+ " | 1 | \n",
+ " ante-tomic-1 | \n",
+ " 61.0 | \n",
+ " NaN | \n",
+ " 22.4 | \n",
+ " 4.3 | \n",
+ " 7.3 | \n",
+ " 0.590 | \n",
+ " 0.0 | \n",
+ " 0.0 | \n",
+ " 0.333 | \n",
+ " ... | \n",
+ " 2.1 | \n",
+ " 4.8 | \n",
+ " 6.9 | \n",
+ " 2.0 | \n",
+ " 0.6 | \n",
+ " 0.6 | \n",
+ " 1.6 | \n",
+ " 2.2 | \n",
+ " 10.8 | \n",
+ " Ante Tomic | \n",
+ "
\n",
+ " \n",
+ " | 2 | \n",
+ " petteri-koponen-1 | \n",
+ " 54.0 | \n",
+ " NaN | \n",
+ " 22.1 | \n",
+ " 3.1 | \n",
+ " 7.2 | \n",
+ " 0.436 | \n",
+ " 1.6 | \n",
+ " 3.8 | \n",
+ " 0.417 | \n",
+ " ... | \n",
+ " 0.3 | \n",
+ " 1.7 | \n",
+ " 1.9 | \n",
+ " 2.1 | \n",
+ " 0.7 | \n",
+ " 0.1 | \n",
+ " 1.3 | \n",
+ " 1.9 | \n",
+ " 9.4 | \n",
+ " Petteri Koponen | \n",
+ "
\n",
+ " \n",
+ " | 3 | \n",
+ " victor-claver-1 | \n",
+ " 56.0 | \n",
+ " NaN | \n",
+ " 21.2 | \n",
+ " 2.0 | \n",
+ " 4.3 | \n",
+ " 0.471 | \n",
+ " 0.9 | \n",
+ " 2.2 | \n",
+ " 0.395 | \n",
+ " ... | \n",
+ " 0.8 | \n",
+ " 3.4 | \n",
+ " 4.3 | \n",
+ " 1.2 | \n",
+ " 0.9 | \n",
+ " 0.4 | \n",
+ " 1.3 | \n",
+ " 2.0 | \n",
+ " 5.5 | \n",
+ " Victor Claver | \n",
+ "
\n",
+ " \n",
+ " | 4 | \n",
+ " aleksandar-vezenkov-1 | \n",
+ " 62.0 | \n",
+ " NaN | \n",
+ " 18.6 | \n",
+ " 3.0 | \n",
+ " 5.5 | \n",
+ " 0.553 | \n",
+ " 1.1 | \n",
+ " 2.7 | \n",
+ " 0.420 | \n",
+ " ... | \n",
+ " 0.9 | \n",
+ " 2.3 | \n",
+ " 3.2 | \n",
+ " 1.0 | \n",
+ " 0.6 | \n",
+ " 0.2 | \n",
+ " 0.7 | \n",
+ " 1.9 | \n",
+ " 8.3 | \n",
+ " Aleksandar Vezenkov | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
5 rows × 26 columns
\n",
+ "
"
+ ],
+ "text/plain": [
+ " player_id g gs mp_per_g fg_per_g fga_per_g fg_pct \\\n",
+ "0 tyrese-rice-1 61.0 NaN 27.5 4.2 10.8 0.390 \n",
+ "1 ante-tomic-1 61.0 NaN 22.4 4.3 7.3 0.590 \n",
+ "2 petteri-koponen-1 54.0 NaN 22.1 3.1 7.2 0.436 \n",
+ "3 victor-claver-1 56.0 NaN 21.2 2.0 4.3 0.471 \n",
+ "4 aleksandar-vezenkov-1 62.0 NaN 18.6 3.0 5.5 0.553 \n",
+ "\n",
+ " fg3_per_g fg3a_per_g fg3_pct ... orb_per_g drb_per_g \\\n",
+ "0 1.6 5.2 0.307 ... 0.2 1.3 \n",
+ "1 0.0 0.0 0.333 ... 2.1 4.8 \n",
+ "2 1.6 3.8 0.417 ... 0.3 1.7 \n",
+ "3 0.9 2.2 0.395 ... 0.8 3.4 \n",
+ "4 1.1 2.7 0.420 ... 0.9 2.3 \n",
+ "\n",
+ " trb_per_g ast_per_g stl_per_g blk_per_g tov_per_g pf_per_g pts_per_g \\\n",
+ "0 1.6 4.1 1.0 0.1 2.5 2.3 12.3 \n",
+ "1 6.9 2.0 0.6 0.6 1.6 2.2 10.8 \n",
+ "2 1.9 2.1 0.7 0.1 1.3 1.9 9.4 \n",
+ "3 4.3 1.2 0.9 0.4 1.3 2.0 5.5 \n",
+ "4 3.2 1.0 0.6 0.2 0.7 1.9 8.3 \n",
+ "\n",
+ " player_name \n",
+ "0 Tyrese Rice \n",
+ "1 Ante Tomic \n",
+ "2 Petteri Koponen \n",
+ "3 Victor Claver \n",
+ "4 Aleksandar Vezenkov \n",
+ "\n",
+ "[5 rows x 26 columns]"
+ ]
+ },
+ "execution_count": 12,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "team.stats_per_game(2017, level='B').head()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " player_id | \n",
+ " g | \n",
+ " gs | \n",
+ " mp | \n",
+ " fg | \n",
+ " fga | \n",
+ " fg_pct | \n",
+ " fg3 | \n",
+ " fg3a | \n",
+ " fg3_pct | \n",
+ " ... | \n",
+ " orb | \n",
+ " drb | \n",
+ " trb | \n",
+ " ast | \n",
+ " stl | \n",
+ " blk | \n",
+ " tov | \n",
+ " pf | \n",
+ " pts | \n",
+ " player_name | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " | 0 | \n",
+ " tyrese-rice-1 | \n",
+ " 61.0 | \n",
+ " NaN | \n",
+ " 1680.0 | \n",
+ " 256.0 | \n",
+ " 657.0 | \n",
+ " 0.390 | \n",
+ " 98.0 | \n",
+ " 319.0 | \n",
+ " 0.307 | \n",
+ " ... | \n",
+ " 15.0 | \n",
+ " 80.0 | \n",
+ " 95.0 | \n",
+ " 252.0 | \n",
+ " 58.0 | \n",
+ " 4.0 | \n",
+ " 151.0 | \n",
+ " 142.0 | \n",
+ " 750.0 | \n",
+ " Tyrese Rice | \n",
+ "
\n",
+ " \n",
+ " | 1 | \n",
+ " ante-tomic-1 | \n",
+ " 61.0 | \n",
+ " NaN | \n",
+ " 1367.0 | \n",
+ " 262.0 | \n",
+ " 444.0 | \n",
+ " 0.590 | \n",
+ " 1.0 | \n",
+ " 3.0 | \n",
+ " 0.333 | \n",
+ " ... | \n",
+ " 128.0 | \n",
+ " 295.0 | \n",
+ " 423.0 | \n",
+ " 124.0 | \n",
+ " 35.0 | \n",
+ " 36.0 | \n",
+ " 99.0 | \n",
+ " 135.0 | \n",
+ " 661.0 | \n",
+ " Ante Tomic | \n",
+ "
\n",
+ " \n",
+ " | 2 | \n",
+ " petteri-koponen-1 | \n",
+ " 54.0 | \n",
+ " NaN | \n",
+ " 1196.0 | \n",
+ " 169.0 | \n",
+ " 388.0 | \n",
+ " 0.436 | \n",
+ " 85.0 | \n",
+ " 204.0 | \n",
+ " 0.417 | \n",
+ " ... | \n",
+ " 15.0 | \n",
+ " 90.0 | \n",
+ " 105.0 | \n",
+ " 112.0 | \n",
+ " 39.0 | \n",
+ " 3.0 | \n",
+ " 71.0 | \n",
+ " 100.0 | \n",
+ " 509.0 | \n",
+ " Petteri Koponen | \n",
+ "
\n",
+ " \n",
+ " | 3 | \n",
+ " victor-claver-1 | \n",
+ " 56.0 | \n",
+ " NaN | \n",
+ " 1187.0 | \n",
+ " 112.0 | \n",
+ " 238.0 | \n",
+ " 0.471 | \n",
+ " 49.0 | \n",
+ " 124.0 | \n",
+ " 0.395 | \n",
+ " ... | \n",
+ " 46.0 | \n",
+ " 192.0 | \n",
+ " 238.0 | \n",
+ " 69.0 | \n",
+ " 51.0 | \n",
+ " 24.0 | \n",
+ " 74.0 | \n",
+ " 111.0 | \n",
+ " 309.0 | \n",
+ " Victor Claver | \n",
+ "
\n",
+ " \n",
+ " | 4 | \n",
+ " aleksandar-vezenkov-1 | \n",
+ " 62.0 | \n",
+ " NaN | \n",
+ " 1156.0 | \n",
+ " 187.0 | \n",
+ " 338.0 | \n",
+ " 0.553 | \n",
+ " 71.0 | \n",
+ " 169.0 | \n",
+ " 0.420 | \n",
+ " ... | \n",
+ " 55.0 | \n",
+ " 143.0 | \n",
+ " 198.0 | \n",
+ " 61.0 | \n",
+ " 37.0 | \n",
+ " 15.0 | \n",
+ " 45.0 | \n",
+ " 115.0 | \n",
+ " 513.0 | \n",
+ " Aleksandar Vezenkov | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
5 rows × 26 columns
\n",
+ "
"
+ ],
+ "text/plain": [
+ " player_id g gs mp fg fga fg_pct fg3 fg3a \\\n",
+ "0 tyrese-rice-1 61.0 NaN 1680.0 256.0 657.0 0.390 98.0 319.0 \n",
+ "1 ante-tomic-1 61.0 NaN 1367.0 262.0 444.0 0.590 1.0 3.0 \n",
+ "2 petteri-koponen-1 54.0 NaN 1196.0 169.0 388.0 0.436 85.0 204.0 \n",
+ "3 victor-claver-1 56.0 NaN 1187.0 112.0 238.0 0.471 49.0 124.0 \n",
+ "4 aleksandar-vezenkov-1 62.0 NaN 1156.0 187.0 338.0 0.553 71.0 169.0 \n",
+ "\n",
+ " fg3_pct ... orb drb trb ast stl blk \\\n",
+ "0 0.307 ... 15.0 80.0 95.0 252.0 58.0 4.0 \n",
+ "1 0.333 ... 128.0 295.0 423.0 124.0 35.0 36.0 \n",
+ "2 0.417 ... 15.0 90.0 105.0 112.0 39.0 3.0 \n",
+ "3 0.395 ... 46.0 192.0 238.0 69.0 51.0 24.0 \n",
+ "4 0.420 ... 55.0 143.0 198.0 61.0 37.0 15.0 \n",
+ "\n",
+ " tov pf pts player_name \n",
+ "0 151.0 142.0 750.0 Tyrese Rice \n",
+ "1 99.0 135.0 661.0 Ante Tomic \n",
+ "2 71.0 100.0 509.0 Petteri Koponen \n",
+ "3 74.0 111.0 309.0 Victor Claver \n",
+ "4 45.0 115.0 513.0 Aleksandar Vezenkov \n",
+ "\n",
+ "[5 rows x 26 columns]"
+ ]
+ },
+ "execution_count": 13,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "team.stats_totals(2017, level='B').head()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " player_id | \n",
+ " g | \n",
+ " gs | \n",
+ " mp | \n",
+ " fg_per_mp | \n",
+ " fga_per_mp | \n",
+ " fg_pct | \n",
+ " fg3_per_mp | \n",
+ " fg3a_per_mp | \n",
+ " fg3_pct | \n",
+ " ... | \n",
+ " orb_per_mp | \n",
+ " drb_per_mp | \n",
+ " trb_per_mp | \n",
+ " ast_per_mp | \n",
+ " stl_per_mp | \n",
+ " blk_per_mp | \n",
+ " tov_per_mp | \n",
+ " pf_per_mp | \n",
+ " pts_per_mp | \n",
+ " player_name | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " | 0 | \n",
+ " tyrese-rice-1 | \n",
+ " 61.0 | \n",
+ " NaN | \n",
+ " 1680.0 | \n",
+ " 5.5 | \n",
+ " 14.1 | \n",
+ " 0.390 | \n",
+ " 2.1 | \n",
+ " 6.8 | \n",
+ " 0.307 | \n",
+ " ... | \n",
+ " 0.3 | \n",
+ " 1.7 | \n",
+ " 2.0 | \n",
+ " 5.4 | \n",
+ " 1.2 | \n",
+ " 0.1 | \n",
+ " 3.2 | \n",
+ " 3.0 | \n",
+ " 16.1 | \n",
+ " Tyrese Rice | \n",
+ "
\n",
+ " \n",
+ " | 1 | \n",
+ " ante-tomic-1 | \n",
+ " 61.0 | \n",
+ " NaN | \n",
+ " 1367.0 | \n",
+ " 6.9 | \n",
+ " 11.7 | \n",
+ " 0.590 | \n",
+ " 0.0 | \n",
+ " 0.1 | \n",
+ " 0.333 | \n",
+ " ... | \n",
+ " 3.4 | \n",
+ " 7.8 | \n",
+ " 11.1 | \n",
+ " 3.3 | \n",
+ " 0.9 | \n",
+ " 0.9 | \n",
+ " 2.6 | \n",
+ " 3.6 | \n",
+ " 17.4 | \n",
+ " Ante Tomic | \n",
+ "
\n",
+ " \n",
+ " | 2 | \n",
+ " petteri-koponen-1 | \n",
+ " 54.0 | \n",
+ " NaN | \n",
+ " 1196.0 | \n",
+ " 5.1 | \n",
+ " 11.7 | \n",
+ " 0.436 | \n",
+ " 2.6 | \n",
+ " 6.1 | \n",
+ " 0.417 | \n",
+ " ... | \n",
+ " 0.5 | \n",
+ " 2.7 | \n",
+ " 3.2 | \n",
+ " 3.4 | \n",
+ " 1.2 | \n",
+ " 0.1 | \n",
+ " 2.1 | \n",
+ " 3.0 | \n",
+ " 15.3 | \n",
+ " Petteri Koponen | \n",
+ "
\n",
+ " \n",
+ " | 3 | \n",
+ " victor-claver-1 | \n",
+ " 56.0 | \n",
+ " NaN | \n",
+ " 1187.0 | \n",
+ " 3.4 | \n",
+ " 7.2 | \n",
+ " 0.471 | \n",
+ " 1.5 | \n",
+ " 3.8 | \n",
+ " 0.395 | \n",
+ " ... | \n",
+ " 1.4 | \n",
+ " 5.8 | \n",
+ " 7.2 | \n",
+ " 2.1 | \n",
+ " 1.5 | \n",
+ " 0.7 | \n",
+ " 2.2 | \n",
+ " 3.4 | \n",
+ " 9.4 | \n",
+ " Victor Claver | \n",
+ "
\n",
+ " \n",
+ " | 4 | \n",
+ " aleksandar-vezenkov-1 | \n",
+ " 62.0 | \n",
+ " NaN | \n",
+ " 1156.0 | \n",
+ " 5.8 | \n",
+ " 10.5 | \n",
+ " 0.553 | \n",
+ " 2.2 | \n",
+ " 5.3 | \n",
+ " 0.420 | \n",
+ " ... | \n",
+ " 1.7 | \n",
+ " 4.5 | \n",
+ " 6.2 | \n",
+ " 1.9 | \n",
+ " 1.2 | \n",
+ " 0.5 | \n",
+ " 1.4 | \n",
+ " 3.6 | \n",
+ " 16.0 | \n",
+ " Aleksandar Vezenkov | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
5 rows × 26 columns
\n",
+ "
"
+ ],
+ "text/plain": [
+ " player_id g gs mp fg_per_mp fga_per_mp fg_pct \\\n",
+ "0 tyrese-rice-1 61.0 NaN 1680.0 5.5 14.1 0.390 \n",
+ "1 ante-tomic-1 61.0 NaN 1367.0 6.9 11.7 0.590 \n",
+ "2 petteri-koponen-1 54.0 NaN 1196.0 5.1 11.7 0.436 \n",
+ "3 victor-claver-1 56.0 NaN 1187.0 3.4 7.2 0.471 \n",
+ "4 aleksandar-vezenkov-1 62.0 NaN 1156.0 5.8 10.5 0.553 \n",
+ "\n",
+ " fg3_per_mp fg3a_per_mp fg3_pct ... orb_per_mp \\\n",
+ "0 2.1 6.8 0.307 ... 0.3 \n",
+ "1 0.0 0.1 0.333 ... 3.4 \n",
+ "2 2.6 6.1 0.417 ... 0.5 \n",
+ "3 1.5 3.8 0.395 ... 1.4 \n",
+ "4 2.2 5.3 0.420 ... 1.7 \n",
+ "\n",
+ " drb_per_mp trb_per_mp ast_per_mp stl_per_mp blk_per_mp tov_per_mp \\\n",
+ "0 1.7 2.0 5.4 1.2 0.1 3.2 \n",
+ "1 7.8 11.1 3.3 0.9 0.9 2.6 \n",
+ "2 2.7 3.2 3.4 1.2 0.1 2.1 \n",
+ "3 5.8 7.2 2.1 1.5 0.7 2.2 \n",
+ "4 4.5 6.2 1.9 1.2 0.5 1.4 \n",
+ "\n",
+ " pf_per_mp pts_per_mp player_name \n",
+ "0 3.0 16.1 Tyrese Rice \n",
+ "1 3.6 17.4 Ante Tomic \n",
+ "2 3.0 15.3 Petteri Koponen \n",
+ "3 3.4 9.4 Victor Claver \n",
+ "4 3.6 16.0 Aleksandar Vezenkov \n",
+ "\n",
+ "[5 rows x 26 columns]"
+ ]
+ },
+ "execution_count": 14,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "team.stats_per36(2017, level='B').head()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " player_id | \n",
+ " g | \n",
+ " mp | \n",
+ " ts_pct | \n",
+ " efg_pct | \n",
+ " fg3a_per_fga_pct | \n",
+ " fta_per_fga_pct | \n",
+ " ast_pct | \n",
+ " tov_pct | \n",
+ " usg_pct | \n",
+ " player_name | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " | 0 | \n",
+ " tyrese-rice-1 | \n",
+ " 61.0 | \n",
+ " 1680.0 | \n",
+ " 0.511 | \n",
+ " NaN | \n",
+ " 0.486 | \n",
+ " 0.265 | \n",
+ " 31.0 | \n",
+ " 17.1 | \n",
+ " 26.9 | \n",
+ " Tyrese Rice | \n",
+ "
\n",
+ " \n",
+ " | 1 | \n",
+ " ante-tomic-1 | \n",
+ " 61.0 | \n",
+ " 1367.0 | \n",
+ " 0.605 | \n",
+ " NaN | \n",
+ " 0.007 | \n",
+ " 0.525 | \n",
+ " 20.4 | \n",
+ " 15.3 | \n",
+ " 24.1 | \n",
+ " Ante Tomic | \n",
+ "
\n",
+ " \n",
+ " | 2 | \n",
+ " petteri-koponen-1 | \n",
+ " 54.0 | \n",
+ " 1196.0 | \n",
+ " 0.593 | \n",
+ " NaN | \n",
+ " 0.526 | \n",
+ " 0.242 | \n",
+ " 18.9 | \n",
+ " 14.2 | \n",
+ " 21.4 | \n",
+ " Petteri Koponen | \n",
+ "
\n",
+ " \n",
+ " | 3 | \n",
+ " victor-claver-1 | \n",
+ " 56.0 | \n",
+ " 1187.0 | \n",
+ " 0.594 | \n",
+ " NaN | \n",
+ " 0.521 | \n",
+ " 0.210 | \n",
+ " 10.7 | \n",
+ " 22.2 | \n",
+ " 14.4 | \n",
+ " Victor Claver | \n",
+ "
\n",
+ " \n",
+ " | 4 | \n",
+ " aleksandar-vezenkov-1 | \n",
+ " 62.0 | \n",
+ " 1156.0 | \n",
+ " 0.686 | \n",
+ " NaN | \n",
+ " 0.500 | \n",
+ " 0.240 | \n",
+ " 11.1 | \n",
+ " 10.7 | \n",
+ " 18.5 | \n",
+ " Aleksandar Vezenkov | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ " player_id g mp ts_pct efg_pct fg3a_per_fga_pct \\\n",
+ "0 tyrese-rice-1 61.0 1680.0 0.511 NaN 0.486 \n",
+ "1 ante-tomic-1 61.0 1367.0 0.605 NaN 0.007 \n",
+ "2 petteri-koponen-1 54.0 1196.0 0.593 NaN 0.526 \n",
+ "3 victor-claver-1 56.0 1187.0 0.594 NaN 0.521 \n",
+ "4 aleksandar-vezenkov-1 62.0 1156.0 0.686 NaN 0.500 \n",
+ "\n",
+ " fta_per_fga_pct ast_pct tov_pct usg_pct player_name \n",
+ "0 0.265 31.0 17.1 26.9 Tyrese Rice \n",
+ "1 0.525 20.4 15.3 24.1 Ante Tomic \n",
+ "2 0.242 18.9 14.2 21.4 Petteri Koponen \n",
+ "3 0.210 10.7 22.2 14.4 Victor Claver \n",
+ "4 0.240 11.1 10.7 18.5 Aleksandar Vezenkov "
+ ]
+ },
+ "execution_count": 15,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "team.stats_advanced(2017, level='B').head()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Schedule: uses kind, because it must be concatenated"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 19,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "65\n"
+ ]
+ },
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " g | \n",
+ " boxscore_id | \n",
+ " is_home | \n",
+ " opp_name_link | \n",
+ " game_result | \n",
+ " overtimes | \n",
+ " pts | \n",
+ " opp_pts | \n",
+ " wins | \n",
+ " losses | \n",
+ " game_streak | \n",
+ " is_playoffs | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " | 0 | \n",
+ " 1.0 | \n",
+ " 2016-10-02-manresa | \n",
+ " False | \n",
+ " /euro/teams/manresa/2017.html | \n",
+ " W | \n",
+ " NaN | \n",
+ " 56.0 | \n",
+ " 50.0 | \n",
+ " 1.0 | \n",
+ " 0.0 | \n",
+ " W 1 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 1 | \n",
+ " 2.0 | \n",
+ " 2016-10-09-barcelona | \n",
+ " True | \n",
+ " /euro/teams/vitoria/2017.html | \n",
+ " W | \n",
+ " NaN | \n",
+ " 98.0 | \n",
+ " 92.0 | \n",
+ " 2.0 | \n",
+ " 0.0 | \n",
+ " W 2 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 2 | \n",
+ " 3.0 | \n",
+ " 2016-10-16-bilbao | \n",
+ " False | \n",
+ " /euro/teams/bilbao/2017.html | \n",
+ " L | \n",
+ " NaN | \n",
+ " 79.0 | \n",
+ " 92.0 | \n",
+ " 2.0 | \n",
+ " 1.0 | \n",
+ " L 1 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 3 | \n",
+ " 4.0 | \n",
+ " 2016-10-23-barcelona | \n",
+ " True | \n",
+ " /euro/teams/sevilla/2017.html | \n",
+ " W | \n",
+ " NaN | \n",
+ " 80.0 | \n",
+ " 58.0 | \n",
+ " 3.0 | \n",
+ " 1.0 | \n",
+ " W 1 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 4 | \n",
+ " 5.0 | \n",
+ " 2016-10-30-fuenlabrada | \n",
+ " False | \n",
+ " /euro/teams/fuenlabrada/2017.html | \n",
+ " W | \n",
+ " NaN | \n",
+ " 78.0 | \n",
+ " 75.0 | \n",
+ " 4.0 | \n",
+ " 1.0 | \n",
+ " W 2 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ " g boxscore_id is_home opp_name_link \\\n",
+ "0 1.0 2016-10-02-manresa False /euro/teams/manresa/2017.html \n",
+ "1 2.0 2016-10-09-barcelona True /euro/teams/vitoria/2017.html \n",
+ "2 3.0 2016-10-16-bilbao False /euro/teams/bilbao/2017.html \n",
+ "3 4.0 2016-10-23-barcelona True /euro/teams/sevilla/2017.html \n",
+ "4 5.0 2016-10-30-fuenlabrada False /euro/teams/fuenlabrada/2017.html \n",
+ "\n",
+ " game_result overtimes pts opp_pts wins losses game_streak is_playoffs \n",
+ "0 W NaN 56.0 50.0 1.0 0.0 W 1 False \n",
+ "1 W NaN 98.0 92.0 2.0 0.0 W 2 False \n",
+ "2 L NaN 79.0 92.0 2.0 1.0 L 1 False \n",
+ "3 W NaN 80.0 58.0 3.0 1.0 W 1 False \n",
+ "4 W NaN 78.0 75.0 4.0 1.0 W 2 False "
+ ]
+ },
+ "execution_count": 19,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "print(len(team.schedule(2017, kind='B')))\n",
+ "team.schedule(2017, kind='B').head()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 21,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "35\n"
+ ]
+ },
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " g | \n",
+ " boxscore_id | \n",
+ " is_home | \n",
+ " opp_name_link | \n",
+ " game_result | \n",
+ " overtimes | \n",
+ " pts | \n",
+ " opp_pts | \n",
+ " wins | \n",
+ " losses | \n",
+ " game_streak | \n",
+ " is_playoffs | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " | 0 | \n",
+ " 1.0 | \n",
+ " 2016-10-02-manresa | \n",
+ " False | \n",
+ " /euro/teams/manresa/2017.html | \n",
+ " W | \n",
+ " NaN | \n",
+ " 56.0 | \n",
+ " 50.0 | \n",
+ " 1.0 | \n",
+ " 0.0 | \n",
+ " W 1 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 1 | \n",
+ " 2.0 | \n",
+ " 2016-10-09-barcelona | \n",
+ " True | \n",
+ " /euro/teams/vitoria/2017.html | \n",
+ " W | \n",
+ " NaN | \n",
+ " 98.0 | \n",
+ " 92.0 | \n",
+ " 2.0 | \n",
+ " 0.0 | \n",
+ " W 2 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 2 | \n",
+ " 3.0 | \n",
+ " 2016-10-16-bilbao | \n",
+ " False | \n",
+ " /euro/teams/bilbao/2017.html | \n",
+ " L | \n",
+ " NaN | \n",
+ " 79.0 | \n",
+ " 92.0 | \n",
+ " 2.0 | \n",
+ " 1.0 | \n",
+ " L 1 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 3 | \n",
+ " 4.0 | \n",
+ " 2016-10-23-barcelona | \n",
+ " True | \n",
+ " /euro/teams/sevilla/2017.html | \n",
+ " W | \n",
+ " NaN | \n",
+ " 80.0 | \n",
+ " 58.0 | \n",
+ " 3.0 | \n",
+ " 1.0 | \n",
+ " W 1 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 4 | \n",
+ " 5.0 | \n",
+ " 2016-10-30-fuenlabrada | \n",
+ " False | \n",
+ " /euro/teams/fuenlabrada/2017.html | \n",
+ " W | \n",
+ " NaN | \n",
+ " 78.0 | \n",
+ " 75.0 | \n",
+ " 4.0 | \n",
+ " 1.0 | \n",
+ " W 2 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ " g boxscore_id is_home opp_name_link \\\n",
+ "0 1.0 2016-10-02-manresa False /euro/teams/manresa/2017.html \n",
+ "1 2.0 2016-10-09-barcelona True /euro/teams/vitoria/2017.html \n",
+ "2 3.0 2016-10-16-bilbao False /euro/teams/bilbao/2017.html \n",
+ "3 4.0 2016-10-23-barcelona True /euro/teams/sevilla/2017.html \n",
+ "4 5.0 2016-10-30-fuenlabrada False /euro/teams/fuenlabrada/2017.html \n",
+ "\n",
+ " game_result overtimes pts opp_pts wins losses game_streak is_playoffs \n",
+ "0 W NaN 56.0 50.0 1.0 0.0 W 1 False \n",
+ "1 W NaN 98.0 92.0 2.0 0.0 W 2 False \n",
+ "2 L NaN 79.0 92.0 2.0 1.0 L 1 False \n",
+ "3 W NaN 80.0 58.0 3.0 1.0 W 1 False \n",
+ "4 W NaN 78.0 75.0 4.0 1.0 W 2 False "
+ ]
+ },
+ "execution_count": 21,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "print(len(team.schedule(2017, kind='R')))\n",
+ "team.schedule(2017, kind='R').head()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 20,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "30\n"
+ ]
+ },
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " g | \n",
+ " boxscore_id | \n",
+ " is_home | \n",
+ " opp_name_link | \n",
+ " game_result | \n",
+ " overtimes | \n",
+ " pts | \n",
+ " opp_pts | \n",
+ " wins | \n",
+ " losses | \n",
+ " game_streak | \n",
+ " is_playoffs | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " | 0 | \n",
+ " 1.0 | \n",
+ " 2016-10-14-unics-kazan | \n",
+ " False | \n",
+ " /euro/teams/unics-kazan/2017.html | \n",
+ " W | \n",
+ " NaN | \n",
+ " 69.0 | \n",
+ " 63.0 | \n",
+ " 1.0 | \n",
+ " 0.0 | \n",
+ " W 1 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | 1 | \n",
+ " 2.0 | \n",
+ " 2016-10-21-barcelona | \n",
+ " True | \n",
+ " /euro/teams/ulker-fenerbahce/2017.html | \n",
+ " L | \n",
+ " NaN | \n",
+ " 72.0 | \n",
+ " 73.0 | \n",
+ " 1.0 | \n",
+ " 1.0 | \n",
+ " L 1 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | 2 | \n",
+ " 3.0 | \n",
+ " 2016-10-26-red-star | \n",
+ " False | \n",
+ " /euro/teams/red-star/2017.html | \n",
+ " L | \n",
+ " NaN | \n",
+ " 65.0 | \n",
+ " 76.0 | \n",
+ " 1.0 | \n",
+ " 2.0 | \n",
+ " L 2 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | 3 | \n",
+ " 4.0 | \n",
+ " 2016-10-28-barcelona | \n",
+ " True | \n",
+ " /euro/teams/brose-baskets/2017.html | \n",
+ " W | \n",
+ " NaN | \n",
+ " 78.0 | \n",
+ " 74.0 | \n",
+ " 2.0 | \n",
+ " 2.0 | \n",
+ " W 1 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | 4 | \n",
+ " 5.0 | \n",
+ " 2016-11-02-maccabi-tel-aviv | \n",
+ " False | \n",
+ " /euro/teams/maccabi-tel-aviv/2017.html | \n",
+ " W | \n",
+ " NaN | \n",
+ " 79.0 | \n",
+ " 69.0 | \n",
+ " 3.0 | \n",
+ " 2.0 | \n",
+ " W 2 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ " g boxscore_id is_home \\\n",
+ "0 1.0 2016-10-14-unics-kazan False \n",
+ "1 2.0 2016-10-21-barcelona True \n",
+ "2 3.0 2016-10-26-red-star False \n",
+ "3 4.0 2016-10-28-barcelona True \n",
+ "4 5.0 2016-11-02-maccabi-tel-aviv False \n",
+ "\n",
+ " opp_name_link game_result overtimes pts \\\n",
+ "0 /euro/teams/unics-kazan/2017.html W NaN 69.0 \n",
+ "1 /euro/teams/ulker-fenerbahce/2017.html L NaN 72.0 \n",
+ "2 /euro/teams/red-star/2017.html L NaN 65.0 \n",
+ "3 /euro/teams/brose-baskets/2017.html W NaN 78.0 \n",
+ "4 /euro/teams/maccabi-tel-aviv/2017.html W NaN 79.0 \n",
+ "\n",
+ " opp_pts wins losses game_streak is_playoffs \n",
+ "0 63.0 1.0 0.0 W 1 True \n",
+ "1 73.0 1.0 1.0 L 1 True \n",
+ "2 76.0 1.0 2.0 L 2 True \n",
+ "3 74.0 2.0 2.0 W 1 True \n",
+ "4 69.0 3.0 2.0 W 2 True "
+ ]
+ },
+ "execution_count": 20,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "print(len(team.schedule(2017, kind='P')))\n",
+ "team.schedule(2017, kind='P').head()"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 3",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.6.3"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}