The Cori-share (% of shot attempts) for each team
        
        :returns: dict, ``{ 'home_name': %, 'away_name': % }``
553348
def share(self):
        
        tot = sum(self.total.values())
        return { k: v/float(tot) for k,v in self.total.items() }
307120
def get_season_team(self, season_key, season_team_key,stats_type=None):
        
        params = {"stats_type": stats_type}
        season_team_url = self.api_path + 'season/' +  season_key + '/team/' + season_team_key + '/'
        response = self.get_response(season_team_url, params=params)
        return response
1354730
def common_all_players(
        season,
        is_only_current_season=0,
        league_id=NbaStats::Constants::LEAGUE_ID_NBA
    )
      NbaStats::Resources::CommonAllPlayers.new(
          get(COMMON_ALL_PLAYERS_PATH, {
              :LeagueID => league_id,
              :Season => season,
              :IsOnlyCurrentSeason => is_only_current_season
          })
      )
    end
1092474
def get_projected_player_game_stats_by_week(self, season, week):
        
        result = self._method_call("PlayerGameProjectionStatsByWeek/{season}/{week}", "projections", season=season, week=week)
        return result
915971
def dataframe(self):
        
        fields_to_include = {
            'assist_percentage': self.assist_percentage,
            'assists': self.assists,
            'block_percentage': self.block_percentage,
            'blocks': self.blocks,
            'box_plus_minus': self.box_plus_minus,
            'defensive_rating': self.defensive_rating,
            'defensive_rebound_percentage': self.defensive_rebound_percentage,
            'defensive_rebounds': self.defensive_rebounds,
            'effective_field_goal_percentage':
            self.effective_field_goal_percentage,
            'field_goal_attempts': self.field_goal_attempts,
            'field_goal_percentage': self.field_goal_percentage,
            'field_goals': self.field_goals,
            'free_throw_attempt_rate': self.free_throw_attempt_rate,
            'free_throw_attempts': self.free_throw_attempts,
            'free_throw_percentage': self.free_throw_percentage,
            'free_throws': self.free_throws,
            'minutes_played': self.minutes_played,
            'offensive_rating': self.offensive_rating,
            'offensive_rebound_percentage': self.offensive_rebound_percentage,
            'offensive_rebounds': self.offensive_rebounds,
            'personal_fouls': self.personal_fouls,
            'points': self.points,
            'steal_percentage': self.steal_percentage,
            'steals': self.steals,
            'three_point_attempt_rate': self.three_point_attempt_rate,
            'three_point_attempts': self.three_point_attempts,
            'three_point_percentage': self.three_point_percentage,
            'three_pointers': self.three_pointers,
            'total_rebound_percentage': self.total_rebound_percentage,
            'total_rebounds': self.total_rebounds,
            'true_shooting_percentage': self.true_shooting_percentage,
            'turnover_percentage': self.turnover_percentage,
            'turnovers': self.turnovers,
            'two_point_attempts': self.two_point_attempts,
            'two_point_percentage': self.two_point_percentage,
            'two_pointers': self.two_pointers,
            'usage_percentage': self.usage_percentage
        }
        return pd.DataFrame([fields_to_include], index=[self._player_id])
719262
def get_winner
      ls = get_boxscore.linescore
      if ls.home_team_runs > ls.away_team_runs
        return home_team_abbrev
      else
        return visit_team_abbrev
      end
    end
733121
def fo_pct(self):
        
        tots = self.team_totals
        return {
            t: tots[t]['won']/(1.0*tots[t]['total']) if tots[t]['total'] else 0.0
            for t in [ 'home', 'away' ]
        }
1043775
def channels(self):
        
        resp = self._rtm_client.get('v1/current_team.channels')
        if resp.is_fail():
            raise RTMServiceError(
                'Failed to get channels of current team',
                resp
            )
        return resp.data['result']
457894
def print_linescore
    	bs = get_boxscore
    	output = ''
    	if bs.linescore 
      	output += self.visit_team_name + ' ' + bs.linescore.away_team_runs + ' ' + bs.linescore.away_team_hits + ' ' + bs.linescore.away_team_errors + "\n"
      	output += self.home_team_name + ' ' + bs.linescore.home_team_runs + ' ' + bs.linescore.home_team_hits + ' ' + bs.linescore.home_team_errors
      else
      	output += 'No linescore available for ' + @visit_team_name + ' vs. ' + @home_team_name
      end
      output
    end
738359
def get_team_players(self, team):
        
        team_id = self.team_names.get(team, None)
        try:
            req = self._get('teams/{}/'.format(team_id))
            team_players = req.json()['squad']
            if not team_players:
                click.secho("No players found for this team", fg="red", bold=True)
            else:
                self.writer.team_players(team_players)
        except APIErrorException:
            click.secho("No data for the team. Please check the team code.",
                        fg="red", bold=True)
690163
def dataframe(self):
        
        fields_to_include = {
            'abbreviation': self.abbreviation,
            'assists': self.assists,
            'blocks': self.blocks,
            'defensive_rebounds': self.defensive_rebounds,
            'field_goal_attempts': self.field_goal_attempts,
            'field_goal_percentage': self.field_goal_percentage,
            'field_goals': self.field_goals,
            'free_throw_attempts': self.free_throw_attempts,
            'free_throw_percentage': self.free_throw_percentage,
            'free_throws': self.free_throws,
            'games_played': self.games_played,
            'minutes_played': self.minutes_played,
            'name': self.name,
            'offensive_rebounds': self.offensive_rebounds,
            'opp_assists': self.opp_assists,
            'opp_blocks': self.opp_blocks,
            'opp_defensive_rebounds': self.opp_defensive_rebounds,
            'opp_field_goal_attempts': self.opp_field_goal_attempts,
            'opp_field_goal_percentage': self.opp_field_goal_percentage,
            'opp_field_goals': self.opp_field_goals,
            'opp_free_throw_attempts': self.opp_free_throw_attempts,
            'opp_free_throw_percentage': self.opp_free_throw_percentage,
            'opp_free_throws': self.opp_free_throws,
            'opp_offensive_rebounds': self.opp_offensive_rebounds,
            'opp_personal_fouls': self.opp_personal_fouls,
            'opp_points': self.opp_points,
            'opp_steals': self.opp_steals,
            'opp_three_point_field_goal_attempts':
            self.opp_three_point_field_goal_attempts,
            'opp_three_point_field_goal_percentage':
            self.opp_three_point_field_goal_percentage,
            'opp_three_point_field_goals': self.opp_three_point_field_goals,
            'opp_total_rebounds': self.opp_total_rebounds,
            'opp_turnovers': self.opp_turnovers,
            'opp_two_point_field_goal_attempts':
            self.opp_two_point_field_goal_attempts,
            'opp_two_point_field_goal_percentage':
            self.opp_two_point_field_goal_percentage,
            'opp_two_point_field_goals': self.opp_two_point_field_goals,
            'personal_fouls': self.personal_fouls,
            'points': self.points,
            'rank': self.rank,
            'steals': self.steals,
            'three_point_field_goal_attempts':
            self.three_point_field_goal_attempts,
            'three_point_field_goal_percentage':
            self.three_point_field_goal_percentage,
            'three_point_field_goals': self.three_point_field_goals,
            'total_rebounds': self.total_rebounds,
            'turnovers': self.turnovers,
            'two_point_field_goal_attempts':
            self.two_point_field_goal_attempts,
            'two_point_field_goal_percentage':
            self.two_point_field_goal_percentage,
            'two_point_field_goals': self.two_point_field_goals
        }
        return pd.DataFrame([fields_to_include], index=[self._abbreviation])
431451
def winning_abbr(self):
        
        if self.winner == HOME:
            return utils._parse_abbreviation(self._home_name)
        return utils._parse_abbreviation(self._away_name)
979602
def attrs(self):
        """"""
        ret = dict(self.__dict__) # obtain copy of internal __dict__
        del ret["_matches"] # match history is specifically distinguished from player information (and stored separately)
        if self.type != c.COMPUTER: # difficulty only matters for computer playres
            del ret["difficulty"]
        return ret
857925
def hicup_stats_table(self):
        
        headers = OrderedDict()
        headers['Percentage_Ditags_Passed_Through_HiCUP'] = {
            'title': '% Passed',
            'description': 'Percentage Di-Tags Passed Through HiCUP',
            'max': 100,
            'min': 0,
            'suffix': '%',
            'scale': 'YlGn'
        }
        headers['Deduplication_Read_Pairs_Uniques'] = {
            'title': '{} Unique'.format(config.read_count_prefix),
            'description': 'Unique Di-Tags ({})'.format(config.read_count_desc),
            'min': 0,
            'scale': 'PuRd',
            'modify': lambda x: x * config.read_count_multiplier,
            'shared_key': 'read_count'
        }
        headers['Percentage_Uniques'] = {
            'title': '% Duplicates',
            'description': 'Percent Duplicate Di-Tags',
            'max': 100,
            'min': 0,
            'suffix': '%',
            'scale': 'YlGn-rev',
            'modify': lambda x: 100 - x
        }
        headers['Valid_Pairs'] = {
            'title': '{} Valid'.format(config.read_count_prefix),
            'description': 'Valid Pairs ({})'.format(config.read_count_desc),
            'min': 0,
            'scale': 'PuRd',
            'modify': lambda x: x * config.read_count_multiplier,
            'shared_key': 'read_count'
        }
        headers['Percentage_Valid'] = {
            'title': '% Valid',
            'description': 'Percent Valid Pairs',
            'max': 100,
            'min': 0,
            'suffix': '%',
            'scale': 'YlGn'
        }
        headers['Paired_Read_1'] = {
            'title': '{} Pairs Aligned'.format(config.read_count_prefix),
            'description': 'Paired Alignments ({})'.format(config.read_count_desc),
            'min': 0,
            'scale': 'PuRd',
            'modify': lambda x: x * config.read_count_multiplier,
            'shared_key': 'read_count'
        }
        headers['Percentage_Mapped'] = {
            'title': '% Aligned',
            'description': 'Percentage of Paired Alignments',
            'max': 100,
            'min': 0,
            'suffix': '%',
            'scale': 'YlGn'
        }
        self.general_stats_addcols(self.hicup_data, headers, 'HiCUP')
247796
def dataframe(self):
        
        fields_to_include = {
            'completed_passes': self.completed_passes,
            'attempted_passes': self.attempted_passes,
            'passing_completion': self.passing_completion,
            'passing_yards': self.passing_yards,
            'pass_yards_per_attempt': self.pass_yards_per_attempt,
            'adjusted_yards_per_attempt': self.adjusted_yards_per_attempt,
            'passing_touchdowns': self.passing_touchdowns,
            'interceptions_thrown': self.interceptions_thrown,
            'quarterback_rating': self.quarterback_rating,
            'rush_attempts': self.rush_attempts,
            'rush_yards': self.rush_yards,
            'rush_yards_per_attempt': self.rush_yards_per_attempt,
            'rush_touchdowns': self.rush_touchdowns,
            'receptions': self.receptions,
            'receiving_yards': self.receiving_yards,
            'receiving_yards_per_reception':
            self.receiving_yards_per_reception,
            'receiving_touchdowns': self.receiving_touchdowns,
            'plays_from_scrimmage': self.plays_from_scrimmage,
            'yards_from_scrimmage': self.yards_from_scrimmage,
            'yards_from_scrimmage_per_play':
            self.yards_from_scrimmage_per_play,
            'rushing_and_receiving_touchdowns':
            self.rushing_and_receiving_touchdowns,
            'solo_tackles': self.solo_tackles,
            'assists_on_tackles': self.assists_on_tackles,
            'total_tackles': self.total_tackles,
            'tackles_for_loss': self.tackles_for_loss,
            'sacks': self.sacks,
            'interceptions': self.interceptions,
            'yards_returned_from_interceptions':
            self.yards_returned_from_interceptions,
            'yards_returned_per_interception':
            self.yards_returned_per_interception,
            'interceptions_returned_for_touchdown':
            self.interceptions_returned_for_touchdown,
            'passes_defended': self.passes_defended,
            'fumbles_recovered': self.fumbles_recovered,
            'yards_recovered_from_fumble': self.yards_recovered_from_fumble,
            'fumbles_recovered_for_touchdown':
            self.fumbles_recovered_for_touchdown,
            'fumbles_forced': self.fumbles_forced,
            'kickoff_returns': self.kickoff_returns,
            'kickoff_return_yards': self.kickoff_return_yards,
            'average_kickoff_return_yards': self.average_kickoff_return_yards,
            'kickoff_return_touchdowns': self.kickoff_return_touchdowns,
            'punt_returns': self.punt_returns,
            'punt_return_yards': self.punt_return_yards,
            'average_punt_return_yards': self.average_punt_return_yards,
            'punt_return_touchdowns': self.punt_return_touchdowns,
            'extra_points_made': self.extra_points_made,
            'extra_points_attempted': self.extra_points_attempted,
            'extra_point_percentage': self.extra_point_percentage,
            'field_goals_made': self.field_goals_made,
            'field_goals_attempted': self.field_goals_attempted,
            'field_goal_percentage': self.field_goal_percentage,
            'points_kicking': self.points_kicking,
            'punts': self.punts,
            'punting_yards': self.punting_yards,
            'punting_yards_per_punt': self.punting_yards_per_attempt
        }
        return pd.DataFrame([fields_to_include], index=[self._player_id])
1118130
def dataframe(self):
        
        if self._points_scored is None and self._points_allowed is None:
            return None
        fields_to_include = {
            'boxscore_index': self.boxscore_index,
            'date': self.date,
            'datetime': self.datetime,
            'day': self.day,
            'extra_points_attempted': self.extra_points_attempted,
            'extra_points_made': self.extra_points_made,
            'field_goals_attempted': self.field_goals_attempted,
            'field_goals_made': self.field_goals_made,
            'fourth_down_attempts': self.fourth_down_attempts,
            'fourth_down_conversions': self.fourth_down_conversions,
            'interceptions': self.interceptions,
            'location': self.location,
            'opponent_abbr': self.opponent_abbr,
            'opponent_name': self.opponent_name,
            'overtime': self.overtime,
            'pass_attempts': self.pass_attempts,
            'pass_completion_rate': self.pass_completion_rate,
            'pass_completions': self.pass_completions,
            'pass_touchdowns': self.pass_touchdowns,
            'pass_yards': self.pass_yards,
            'pass_yards_per_attempt': self.pass_yards_per_attempt,
            'points_allowed': self.points_allowed,
            'points_scored': self.points_scored,
            'punt_yards': self.punt_yards,
            'punts': self.punts,
            'quarterback_rating': self.quarterback_rating,
            'result': self.result,
            'rush_attempts': self.rush_attempts,
            'rush_touchdowns': self.rush_touchdowns,
            'rush_yards': self.rush_yards,
            'rush_yards_per_attempt': self.rush_yards_per_attempt,
            'third_down_attempts': self.third_down_attempts,
            'third_down_conversions': self.third_down_conversions,
            'time_of_possession': self.time_of_possession,
            'times_sacked': self.times_sacked,
            'type': self.type,
            'week': self.week,
            'yards_lost_from_sacks': self.yards_lost_from_sacks
        }
        return pd.DataFrame([fields_to_include], index=[self._boxscore])
965928
def related(self):
        
        if self._related is None:
            if self.athlete_count - 1 > 0:
                self.assert_bind_client()
                self._related = self.bind_client.get_related_activities(self.id)
            else:
                self._related = []
        return self._related