SHARE
TWEET

Untitled

a guest Sep 18th, 2019 99 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. gravity = pd.read_csv('./gravity.csv')
  2. gravity['gravity'] = gravity['dist_to_defender'] + gravity['teammates_distances']
  3. gravity_on = gravity[gravity['is_dribbling']]
  4. colsToDrop = ['possession_id', 'is_dribbling', 'dist_to_defender', 'teammates_distances']
  5. gravity_metric = gravity_on.drop(colsToDrop, axis=1)
  6. gravity_metric = gravity_metric.groupby('player_id').agg(np.mean)
  7. print(gravity_metric)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top