Skip to content

Commit

Permalink
Merge branch 'boost' of https://github.com/SaltieRL/carball into boost
Browse files Browse the repository at this point in the history
  • Loading branch information
dtracers committed Nov 12, 2019
2 parents 668f2c0 + 4cb0e5c commit daad521
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions carball/analysis/stats/boost/boost.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,12 @@ def get_average_boost_level(player_dataframe: pd.DataFrame) -> np.float64:
def get_num_stolen_boosts(cls, player_dataframe: pd.DataFrame, is_orange):
big = cls.field_constants.get_big_pads()
# Get big pads below or above 0 depending on team
# The index of y position is 1. The index of the label is 2.
if is_orange:
opponent_pad_labels = big[big[:, 1] < 0][:, 2]
opponent_pad_labels = big[big[:, 1] < 0][:, 2] #big[where[y] is < 0][labels]
else:
opponent_pad_labels = big[big[:, 1] > 0][:, 2]
opponent_pad_labels = big[big[:, 1] > 0][:, 2] #big[where[y] is > 0][labels]
# Count all the places where isin = True by summing
stolen = player_dataframe.boost_collect.isin(opponent_pad_labels).sum()
return stolen

Expand Down

0 comments on commit daad521

Please sign in to comment.