Returns a ``float`` of the player's two point field goal percentage
        during the season. Percentage ranges from 0-1.
974165
def two_point_percentage(self):
        
        if self.two_pointers and self.two_point_attempts:
            perc = float(self.two_pointers) / float(self.two_point_attempts)
            return round(perc, 3)
        # Occurs when the player didn't make and two pointers.
        if self.two_point_attempts:
            return 0.0
        return None
451488
def dataframe(self):
        
        fields_to_include = {
            'abbreviation': self.abbreviation,
            'assist_percentage': self.assist_percentage,
            'assists': self.assists,
            'away_losses': self.away_losses,
            'away_wins': self.away_wins,
            'block_percentage': self.block_percentage,
            'blocks': self.blocks,
            'conference': self.conference,
            'conference_losses': self.conference_losses,
            'conference_wins': self.conference_wins,
            '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,
            'free_throws_per_field_goal_attempt':
            self.free_throws_per_field_goal_attempt,
            'games_played': self.games_played,
            'home_losses': self.home_losses,
            'home_wins': self.home_wins,
            'losses': self.losses,
            'minutes_played': self.minutes_played,
            'name': self.name,
            'net_rating': self.net_rating,
            'offensive_rating': self.offensive_rating,
            'offensive_rebound_percentage': self.offensive_rebound_percentage,
            'offensive_rebounds': self.offensive_rebounds,
            'opp_assist_percentage': self.opp_assist_percentage,
            'opp_assists': self.opp_assists,
            'opp_block_percentage': self.opp_block_percentage,
            'opp_blocks': self.opp_blocks,
            'opp_defensive_rebounds': self.opp_defensive_rebounds,
            'opp_effective_field_goal_percentage':
            self.opp_effective_field_goal_percentage,
            '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_attempt_rate': self.opp_free_throw_attempt_rate,
            '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_free_throws_per_field_goal_attempt':
            self.opp_free_throws_per_field_goal_attempt,
            'opp_offensive_rating': self.opp_offensive_rating,
            'opp_offensive_rebound_percentage':
            self.opp_offensive_rebound_percentage,
            'opp_offensive_rebounds': self.opp_offensive_rebounds,
            'opp_personal_fouls': self.opp_personal_fouls,
            'opp_points': self.opp_points,
            'opp_steal_percentage': self.opp_steal_percentage,
            'opp_steals': self.opp_steals,
            'opp_three_point_attempt_rate': self.opp_three_point_attempt_rate,
            '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_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,
            'opp_total_rebound_percentage': self.opp_total_rebound_percentage,
            'opp_total_rebounds': self.opp_total_rebounds,
            'opp_true_shooting_percentage': self.opp_true_shooting_percentage,
            'opp_turnover_percentage': self.opp_turnover_percentage,
            'opp_turnovers': self.opp_turnovers,
            'pace': self.pace,
            'personal_fouls': self.personal_fouls,
            'points': self.points,
            'simple_rating_system': self.simple_rating_system,
            'steal_percentage': self.steal_percentage,
            'steals': self.steals,
            'strength_of_schedule': self.strength_of_schedule,
            'three_point_attempt_rate': self.three_point_attempt_rate,
            '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,
            '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,
            '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,
            'win_percentage': self.win_percentage,
            'wins': self.wins
        }
        return pd.DataFrame([fields_to_include], index=[self._abbreviation])
230455
def percentage(self):
        """"""
        if self.currval >= self.maxval:
            return 100.0
        return self.currval * 100.0 / self.maxval
223363
def health_percentage(self) -> Union[int, float]:
        
        if self._proto.health_max == 0:
            return 0
        return self._proto.health / self._proto.health_max
191759
def home_win_percentage(self):
        
        try:
            result = float(self.home_wins) / \
                     float(self.home_wins + self.home_losses)
            return round(result, 3)
        except ZeroDivisionError:
            return 0.0
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])
1065822
def home_two_point_field_goal_percentage(self):
        
        result = float(self.home_two_point_field_goals) / \
            float(self.home_two_point_field_goal_attempts)
        return round(float(result), 3)
105333
def fscore(beta)
      b2 = Float(beta**2)
      ((b2 + 1) * precision * recall) / (b2 * precision + recall)
    end
1538
def two_point_attempts(self):
        
        if self.field_goal_attempts and self.three_point_attempts:
            return int(self.field_goal_attempts - self.three_point_attempts)
        # Occurs when the player didn't take any three pointers, so the number
        # of two pointers the player took is equal to the total number of field
        # goals the player took.
        if self.field_goal_attempts:
            return int(self.field_goal_attempts)
        # If the player didn't take any shots, they didn't take any two point
        # field goals.
        return None
582287
def win_rate(self):
        
        data = self.pnl
        try:
            return round(len(data.query('pnl_money>0')) / len(data), 2)
        except ZeroDivisionError:
            return 0
986128
def percentage(self):
        
        total_vote_count = self.poll.vote_count
        if total_vote_count:
            return self.vote_count * 100.0 / total_vote_count
        return 0
440909
def home_save_percentage(self):
        
        try:
            save_pct = float(self.home_saves) / float(self.away_shots_on_goal)
            return round(save_pct, 3)
        except ZeroDivisionError:
            return 0.0
315348
def global_unlock_percent(self):
        
        percent = CRef.cfloat()
        result = self._iface.get_ach_progress(self.name, percent)

        if not result:
            return 0.0

        return float(percent)
524495
public function PercentageX()
    {
        if ($field = $this->owner->FocusPoint) {
            return round(DBFocusPoint::focusCoordToOffset($field->getX()) * 100);
        }
        return 0;
    }
326338
public static function percentOf($big, $small, $defaultOnZero = 0)
    {
        $result = $big > 0.01 ? (($small*100)/$big) : $defaultOnZero;
        return self::nFloat($result);
    }
269904
def percentOverlap(x1, x2, numColumns):
    
  nonZeroX1 = np.count_nonzero(x1)
  nonZeroX2 = np.count_nonzero(x2)
  sparseCols = min(nonZeroX1, nonZeroX2)  
  # transform input vector specifying columns into binary vector
  binX1 = np.zeros(numColumns, dtype="uint32")
  binX2 = np.zeros(numColumns, dtype="uint32")
  for i in range(sparseCols):
    binX1[x1[i]] = 1
    binX2[x2[i]] = 1
  return float(np.dot(binX1, binX2))/float(sparseCols)
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' ]
        }