<jupyter_start><jupyter_text>Collecting Info on A Specific Teams Games Over a Specific Period===This vignette shows you how to collect gameids for a specific team during a specific time and aggregate corresponding box score information. Specifically, it will walk you through collecting information on all Phoenix Suns games that took place during December and January of the 2006-07 season.<jupyter_code>import goldsberry
import pandas as pd
pd.set_option("display.max_columns",50) # Change Pandas Display Options
goldsberry.__version__
gameids = goldsberry.GameIDs()
gameids2015 = pd.DataFrame(gameids.game_list())
gameids2015.head()<jupyter_output><empty_output><jupyter_text>Like the PlayerList() class, the GameIDs() class defaults to the current season. If we want the 2006-07 season, we need to identify and change the proper parameters. We can see the available parameters to set by printing the `api_params` attribute.<jupyter_code>gameids.api_params<jupyter_output><empty_output><jupyter_text>From there, we can see we should set the `Season` value to `2006-07`. Once we set the parameter, we need to get new data and then save the new data as a data frame to a new object.<jupyter_code>gameids.get_new_data(Season='2006-07')
gameids2006 = pd.DataFrame(gameids.game_list())
gameids2006.head()<jupyter_output><empty_output><jupyter_text>A quick filter for team names that contain 'Suns' returns all games for the Suns for the 2006-07 season<jupyter_code>suns_logs = gameids2006.ix[gameids2006['TEAM_NAME'].str.contains('Suns')]
suns_logs.head()<jupyter_output><empty_output><jupyter_text>We can verify all of the games are there by checking the shape of the data frame.<jupyter_code>suns_logs.shape<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.07656879677605066, 'fraction_numerical': 0.03223949337938975, 'mean_word_length': 6.828828828828829, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '124230', 'license': 'Apache-2.0', 'n_tokens_mistral': 559, 'n_tokens_neox': 511, 'n_words': 187, 'path': 'py-Goldsberry/docs/2. Get Team Games for Specific Period.ipynb', 'repo_name': 'LiuHao-THU/nba_logistic_regression', 'size': '1737'}