nesticot commited on
Commit
873c34d
·
verified ·
1 Parent(s): 5b0d46c

Update stuff_model/calculate_arm_angles.py

Browse files
stuff_model/calculate_arm_angles.py CHANGED
@@ -36,6 +36,7 @@ def calculate_arm_angles(df: pl.DataFrame,pitcher_id:int) -> pl.DataFrame:
36
  else:
37
  shoulder_x = df_arm_angle.filter(pl.col("pitcher") == pitcher_id)["relative_shoulder_x"][0]
38
  shoulder_z = df_arm_angle.filter(pl.col("pitcher") == pitcher_id)["shoulder_z"][0]
 
39
 
40
  print(shoulder_x, shoulder_z)
41
 
@@ -55,6 +56,10 @@ def calculate_arm_angles(df: pl.DataFrame,pitcher_id:int) -> pl.DataFrame:
55
  #.drop(["Opp", "arm_angle_rad"])
56
  )
57
 
 
 
 
 
58
 
59
 
60
 
 
36
  else:
37
  shoulder_x = df_arm_angle.filter(pl.col("pitcher") == pitcher_id)["relative_shoulder_x"][0]
38
  shoulder_z = df_arm_angle.filter(pl.col("pitcher") == pitcher_id)["shoulder_z"][0]
39
+ ball_angle = df_arm_angle.filter(pl.col("pitcher") == pitcher_id)["ball_angle"][0]
40
 
41
  print(shoulder_x, shoulder_z)
42
 
 
56
  #.drop(["Opp", "arm_angle_rad"])
57
  )
58
 
59
+ df_filter = df_filter.with_columns(
60
+ ((pl.col("arm_angle") * 0.25) + (ball_angle * 0.75)).alias("arm_angle")
61
+ )
62
+
63
 
64
 
65